From 645fc877e6c8fb01f1575d0fbce6a25c65162acf Mon Sep 17 00:00:00 2001 From: hide_d Date: Mon, 20 Dec 2021 01:59:29 +0900 Subject: [PATCH] =?UTF-8?q?build:=20devtool=20=EA=B2=B0=EA=B3=BC=20?= =?UTF-8?q?=EC=B5=9C=EC=A0=81=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webpack.config.cjs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/webpack.config.cjs b/webpack.config.cjs index 265d47c7..bffe1957 100644 --- a/webpack.config.cjs +++ b/webpack.config.cjs @@ -58,7 +58,9 @@ module.exports = (env, argv) => { for (const [entry, filePath] of Object.entries(build_exports.ingame) ?? []) { entryIngame[entry] = `${tsDir}/${filePath}`; } - const cacheDirectory = path.resolve(__dirname, 'node_modules/.cache/webpack') + const cacheDirectory = path.resolve(__dirname, 'node_modules/.cache/webpack'); + + const devtool = mode != 'production' ? 'eval-source-map' : (env.WEBPACK_WATCH ? 'source-map' : undefined); const optimization = { splitChunks: { @@ -104,7 +106,7 @@ module.exports = (env, argv) => { filename: '[name].js', path: resolve(outputPath, 'vue') }, - devtool: 'source-map', + devtool, optimization, module: { rules: [ @@ -215,7 +217,7 @@ module.exports = (env, argv) => { filename: '[name].js', path: resolve(outputPath, 'ts') }, - devtool: 'source-map', + devtool, optimization, module: { rules: [{ @@ -297,7 +299,7 @@ module.exports = (env, argv) => { filename: '[name].js', path: resolve(__dirname, 'dist_js', 'gateway') }, - devtool: 'source-map', + devtool, optimization, module: { rules: [{