Skip to content

Commit a08e670

Browse files
committed
build(webpack): reduce production source maps
Signed-off-by: Grigorii K. Shartsev <[email protected]>
1 parent 8745344 commit a08e670

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

webpack.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ const webpack = require('webpack')
1111
const { mergeWithRules } = require('webpack-merge')
1212
const commonWebpackConfig = require('./webpack.common.config.js')
1313

14+
const IS_PROD = process.env.NODE_ENV === 'production'
15+
1416
module.exports = mergeWithRules({
1517
module: {
1618
// Rules from @nextcloud/webpack-vue-config/rules already added by commonWebpackConfig
@@ -67,4 +69,11 @@ module.exports = mergeWithRules({
6769
],
6870

6971
cache: true,
72+
73+
devtool: IS_PROD
74+
// .js.map files with original file names and lines but without the source code
75+
// Tradeoff choice between dist size and features
76+
? 'nosources-source-map'
77+
// High-quality SourceMaps with faster rebuild for development
78+
: 'eval-source-map',
7079
})

0 commit comments

Comments
 (0)