Optimize build configuration.
This commit is contained in:
parent
1dbafb6c97
commit
6cff7138f0
|
@ -7,7 +7,6 @@
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"module": "CommonJS",
|
|
||||||
"target": "ES2019",
|
"target": "ES2019",
|
||||||
"outDir": "out",
|
"outDir": "out",
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
|
|
|
@ -19,13 +19,15 @@ const config: webpack.Configuration = {
|
||||||
output: {
|
output: {
|
||||||
path: path.resolve(__dirname, 'out'),
|
path: path.resolve(__dirname, 'out'),
|
||||||
filename: 'extension.js',
|
filename: 'extension.js',
|
||||||
libraryTarget: 'commonjs2',
|
library: {
|
||||||
|
type: "commonjs2",
|
||||||
|
},
|
||||||
devtoolModuleFilenameTemplate: '../[resource-path]',
|
devtoolModuleFilenameTemplate: '../[resource-path]',
|
||||||
},
|
},
|
||||||
devtool: isProduction ? false : 'source-map',
|
devtool: isProduction ? false : 'source-map',
|
||||||
optimization: {
|
optimization: {
|
||||||
concatenateModules: true,
|
concatenateModules: true,
|
||||||
minimize: true,
|
minimize: isProduction,
|
||||||
minimizer: [
|
minimizer: [
|
||||||
new TerserPlugin({
|
new TerserPlugin({
|
||||||
extractComments: false,
|
extractComments: false,
|
||||||
|
@ -39,6 +41,9 @@ const config: webpack.Configuration = {
|
||||||
},
|
},
|
||||||
mangle: {
|
mangle: {
|
||||||
module: true,
|
module: true,
|
||||||
|
properties: {
|
||||||
|
regex: /^_/,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
|
Loading…
Reference in New Issue