From bb9c9d83137b26cec4259c285be56313b30d72f7 Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Sun, 16 May 2021 19:41:04 +0200 Subject: [PATCH] fixed webpack sourcemap namespaces --- webpack.plugin.config.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/webpack.plugin.config.js b/webpack.plugin.config.js index 7f5a6863..d4f0f68a 100644 --- a/webpack.plugin.config.js +++ b/webpack.plugin.config.js @@ -6,16 +6,17 @@ const bundleAnalyzer = new BundleAnalyzerPlugin({ analyzerPort: 0, }) -const sourceMapOptions = { - exclude: [/node_modules/, /vendor/], - filename: '[file].map', -} - -if (process.env.CI) { - sourceMapOptions.append = '\n//# sourceMappingURL=../../../app.asar.unpacked/assets/webpack/[url]' -} - module.exports = options => { + const sourceMapOptions = { + exclude: [/node_modules/, /vendor/], + filename: '[file].map', + moduleFilenameTemplate: `webpack-terminus-${options.name}:///[resource-path]`, + } + + if (process.env.CI) { + sourceMapOptions.append = '\n//# sourceMappingURL=../../../app.asar.unpacked/assets/webpack/[url]' + } + const isDev = !!process.env.TERMINUS_DEV const config = { target: 'node', @@ -27,7 +28,6 @@ module.exports = options => { filename: 'index.js', pathinfo: true, libraryTarget: 'umd', - devtoolModuleFilenameTemplate: `webpack-terminus-${options.name}:///[resource-path]`, }, mode: isDev ? 'development' : 'production', optimization:{