From 6cff7138f049de35fbaf01796e3fc92c6051fa45 Mon Sep 17 00:00:00 2001 From: CismonX Date: Tue, 25 May 2021 12:17:36 +0800 Subject: [PATCH] Optimize build configuration. --- tsconfig.json | 1 - webpack.config.ts | 9 +++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 3a47c51..bba6919 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,7 +7,6 @@ */ { "compilerOptions": { - "module": "CommonJS", "target": "ES2019", "outDir": "out", "esModuleInterop": true, diff --git a/webpack.config.ts b/webpack.config.ts index 16700ba..951846e 100644 --- a/webpack.config.ts +++ b/webpack.config.ts @@ -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: /^_/, + }, }, }, }),