From 466f2aa04b6b7d8cafd94a0e0c3a40fbaa470d7a Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Wed, 28 Oct 2020 00:16:04 -0400 Subject: [PATCH] Adds production source-map generation for webviews --- .vscode/launch.json | 4 ++++ .vscodeignore | 3 +-- webpack.config.js | 10 ++++++---- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index c3ec7c5..13b52c0 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -11,6 +11,7 @@ "cwd": "${workspaceFolder}", "debugWebviews": true, "rendererDebugOptions": { + "sourceMaps": true, "urlFilter": "*eamodio.gitlens*", "webRoot": "${workspaceFolder}/src/webviews/apps" }, @@ -33,6 +34,7 @@ "cwd": "${workspaceFolder}", "debugWebviews": true, "rendererDebugOptions": { + "sourceMaps": true, "urlFilter": "*eamodio.gitlens*", "webRoot": "${workspaceFolder}/src/webviews/apps" }, @@ -55,6 +57,7 @@ "cwd": "${workspaceFolder}", "debugWebviews": true, "rendererDebugOptions": { + "sourceMaps": true, "urlFilter": "*eamodio.gitlens*", "webRoot": "${workspaceFolder}/src/webviews/apps" }, @@ -78,6 +81,7 @@ "cwd": "${workspaceFolder}", "debugWebviews": true, "rendererDebugOptions": { + "sourceMaps": true, "urlFilter": "*eamodio.gitlens*", "webRoot": "${workspaceFolder}/src/webviews/apps" }, diff --git a/.vscodeignore b/.vscodeignore index 0116fdb..3d8bf46 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -8,8 +8,7 @@ images/**/*.pdn node_modules/** src/** test/** -*.fig -*.map +**/*.fig .eslintcache .eslintignore .eslintrc.json diff --git a/webpack.config.js b/webpack.config.js index e6de764..65a7d06 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -99,7 +99,7 @@ module.exports = */ function getExtensionConfig(mode, env) { /** - * @type WebpackConfig['plugins'] + * @type WebpackConfig['plugins'] | any */ const plugins = [ new CleanPlugin({ cleanOnceBeforeBuildPatterns: ['**/*', '!**/webviews/**'] }), @@ -146,10 +146,12 @@ function getExtensionConfig(mode, env) { }, optimization: { minimizer: [ + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore new TerserPlugin({ parallel: true, terserOptions: { - ecma: 8, + ecma: 2019, // Keep the class names otherwise @log won't provide a useful name keep_classnames: true, module: true, @@ -227,7 +229,7 @@ function getWebviewsConfig(mode, env) { } /** - * @type WebpackConfig['plugins'] + * @type WebpackConfig['plugins'] | any */ const plugins = [ new CleanPlugin({ cleanOnceBeforeBuildPatterns: clean, cleanStaleWebpackAssets: false }), @@ -362,7 +364,7 @@ function getWebviewsConfig(mode, env) { }, mode: mode, target: 'web', - devtool: mode === 'production' ? undefined : 'eval-source-map', + devtool: 'source-map', output: { filename: '[name].js', path: path.join(__dirname, 'dist/webviews'),