Просмотр исходного кода

Adds production source-map generation for webviews

main
Eric Amodio 4 лет назад
Родитель
Сommit
466f2aa04b
3 измененных файлов: 11 добавлений и 6 удалений
  1. +4
    -0
      .vscode/launch.json
  2. +1
    -2
      .vscodeignore
  3. +6
    -4
      webpack.config.js

+ 4
- 0
.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"
},

+ 1
- 2
.vscodeignore Просмотреть файл

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

+ 6
- 4
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'),

Загрузка…
Отмена
Сохранить