Optimize build configuration.

This commit is contained in:
CismonX 2021-05-25 12:17:36 +08:00
parent 1dbafb6c97
commit 6cff7138f0
Signed by: cismonx
GPG Key ID: 3094873E29A482FB
2 changed files with 7 additions and 3 deletions

View File

@ -7,7 +7,6 @@
*/
{
"compilerOptions": {
"module": "CommonJS",
"target": "ES2019",
"outDir": "out",
"esModuleInterop": true,

View File

@ -19,13 +19,15 @@ const config: webpack.Configuration = {
output: {
path: path.resolve(__dirname, 'out'),
filename: 'extension.js',
libraryTarget: 'commonjs2',
library: {
type: "commonjs2",
},
devtoolModuleFilenameTemplate: '../[resource-path]',
},
devtool: isProduction ? false : 'source-map',
optimization: {
concatenateModules: true,
minimize: true,
minimize: isProduction,
minimizer: [
new TerserPlugin({
extractComments: false,
@ -39,6 +41,9 @@ const config: webpack.Configuration = {
},
mangle: {
module: true,
properties: {
regex: /^_/,
},
},
},
}),