Răsfoiți Sursa

fixed webpack sourcemap namespaces

Eugene Pankov 4 ani în urmă
părinte
comite
bb9c9d8313
1 a modificat fișierele cu 9 adăugiri și 9 ștergeri
  1. 9 9
      webpack.plugin.config.js

+ 9 - 9
webpack.plugin.config.js

@@ -6,16 +6,17 @@ const bundleAnalyzer = new BundleAnalyzerPlugin({
     analyzerPort: 0,
 })
 
-const sourceMapOptions = {
-    exclude: [/node_modules/, /vendor/],
-    filename: '[file].map',
-}
+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]'
-}
+    if (process.env.CI) {
+        sourceMapOptions.append = '\n//# sourceMappingURL=../../../app.asar.unpacked/assets/webpack/[url]'
+    }
 
-module.exports = options => {
     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:{