Explorar el Código

Adds production source-map generation for webviews

main
Eric Amodio hace 4 años
padre
commit
466f2aa04b
Se han modificado 3 ficheros con 11 adiciones y 6 borrados
  1. +4
    -0
      .vscode/launch.json
  2. +1
    -2
      .vscodeignore
  3. +6
    -4
      webpack.config.js

+ 4
- 0
.vscode/launch.json Ver fichero

@ -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"
},

+ 1
- 2
.vscodeignore Ver fichero

@ -8,8 +8,7 @@ images/**/*.pdn
node_modules/**
src/**
test/**
*.fig
*.map
**/*.fig
.eslintcache
.eslintignore
.eslintrc.json

+ 6
- 4
webpack.config.js Ver fichero

@ -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'),

Cargando…
Cancelar
Guardar