Просмотр исходного кода

Use a javascript source map for production builds

This will allow the user to see the original file name and the source
code line number in the case of a Javascript error when using browser's
developer tools.

Note that the full source code can also be enabled in the developer
tools if needed by changing `nosources-source-map` to `source-map` in
`webpack.config` before building.
Sergiu Miclea 7 лет назад
Родитель
Сommit
3fbf97f0d6
1 измененных файлов с 6 добавлено и 1 удалено
  1. 6 1
      webpack.config.js

+ 6 - 1
webpack.config.js

@@ -109,8 +109,13 @@ const config = createConfig([
       app: sourcePath,
     }),
     splitVendor(),
+    () => ({ devtool: 'nosources-source-map' }),
     addPlugins([
-      new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false }, mangle: { keep_fnames: true } }),
+      new webpack.optimize.UglifyJsPlugin({
+        compress: { warnings: false },
+        mangle: { keep_fnames: true },
+        sourceMap: true,
+      }),
     ]),
   ]),
 ])