Przeglądaj źródła

Adds production source-map generation for webviews

main
Eric Amodio 4 lat temu
rodzic
commit
466f2aa04b
3 zmienionych plików z 11 dodań i 6 usunięć
  1. +4
    -0
      .vscode/launch.json
  2. +1
    -2
      .vscodeignore
  3. +6
    -4
      webpack.config.js

+ 4
- 0
.vscode/launch.json Wyświetl plik

@ -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 Wyświetl plik

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

+ 6
- 4
webpack.config.js Wyświetl plik

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

Ładowanie…
Anuluj
Zapisz