Bladeren bron

Adds production source-map generation for webviews

main
Eric Amodio 4 jaren geleden
bovenliggende
commit
466f2aa04b
3 gewijzigde bestanden met toevoegingen van 11 en 6 verwijderingen
  1. +4
    -0
      .vscode/launch.json
  2. +1
    -2
      .vscodeignore
  3. +6
    -4
      webpack.config.js

+ 4
- 0
.vscode/launch.json Bestand weergeven

@ -11,6 +11,7 @@
"cwd": "${workspaceFolder}", "cwd": "${workspaceFolder}",
"debugWebviews": true, "debugWebviews": true,
"rendererDebugOptions": { "rendererDebugOptions": {
"sourceMaps": true,
"urlFilter": "*eamodio.gitlens*", "urlFilter": "*eamodio.gitlens*",
"webRoot": "${workspaceFolder}/src/webviews/apps" "webRoot": "${workspaceFolder}/src/webviews/apps"
}, },
@ -33,6 +34,7 @@
"cwd": "${workspaceFolder}", "cwd": "${workspaceFolder}",
"debugWebviews": true, "debugWebviews": true,
"rendererDebugOptions": { "rendererDebugOptions": {
"sourceMaps": true,
"urlFilter": "*eamodio.gitlens*", "urlFilter": "*eamodio.gitlens*",
"webRoot": "${workspaceFolder}/src/webviews/apps" "webRoot": "${workspaceFolder}/src/webviews/apps"
}, },
@ -55,6 +57,7 @@
"cwd": "${workspaceFolder}", "cwd": "${workspaceFolder}",
"debugWebviews": true, "debugWebviews": true,
"rendererDebugOptions": { "rendererDebugOptions": {
"sourceMaps": true,
"urlFilter": "*eamodio.gitlens*", "urlFilter": "*eamodio.gitlens*",
"webRoot": "${workspaceFolder}/src/webviews/apps" "webRoot": "${workspaceFolder}/src/webviews/apps"
}, },
@ -78,6 +81,7 @@
"cwd": "${workspaceFolder}", "cwd": "${workspaceFolder}",
"debugWebviews": true, "debugWebviews": true,
"rendererDebugOptions": { "rendererDebugOptions": {
"sourceMaps": true,
"urlFilter": "*eamodio.gitlens*", "urlFilter": "*eamodio.gitlens*",
"webRoot": "${workspaceFolder}/src/webviews/apps" "webRoot": "${workspaceFolder}/src/webviews/apps"
}, },

+ 1
- 2
.vscodeignore Bestand weergeven

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

+ 6
- 4
webpack.config.js Bestand weergeven

@ -99,7 +99,7 @@ module.exports =
*/ */
function getExtensionConfig(mode, env) { function getExtensionConfig(mode, env) {
/** /**
* @type WebpackConfig['plugins']
* @type WebpackConfig['plugins'] | any
*/ */
const plugins = [ const plugins = [
new CleanPlugin({ cleanOnceBeforeBuildPatterns: ['**/*', '!**/webviews/**'] }), new CleanPlugin({ cleanOnceBeforeBuildPatterns: ['**/*', '!**/webviews/**'] }),
@ -146,10 +146,12 @@ function getExtensionConfig(mode, env) {
}, },
optimization: { optimization: {
minimizer: [ minimizer: [
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
new TerserPlugin({ new TerserPlugin({
parallel: true, parallel: true,
terserOptions: { terserOptions: {
ecma: 8,
ecma: 2019,
// Keep the class names otherwise @log won't provide a useful name // Keep the class names otherwise @log won't provide a useful name
keep_classnames: true, keep_classnames: true,
module: true, module: true,
@ -227,7 +229,7 @@ function getWebviewsConfig(mode, env) {
} }
/** /**
* @type WebpackConfig['plugins']
* @type WebpackConfig['plugins'] | any
*/ */
const plugins = [ const plugins = [
new CleanPlugin({ cleanOnceBeforeBuildPatterns: clean, cleanStaleWebpackAssets: false }), new CleanPlugin({ cleanOnceBeforeBuildPatterns: clean, cleanStaleWebpackAssets: false }),
@ -362,7 +364,7 @@ function getWebviewsConfig(mode, env) {
}, },
mode: mode, mode: mode,
target: 'web', target: 'web',
devtool: mode === 'production' ? undefined : 'eval-source-map',
devtool: 'source-map',
output: { output: {
filename: '[name].js', filename: '[name].js',
path: path.join(__dirname, 'dist/webviews'), path: path.join(__dirname, 'dist/webviews'),

Laden…
Annuleren
Opslaan