Skip to content

Commit e2df8d5

Browse files
authored
Merge pull request #15 from sytranvn/webpack-prod-mode
2 parents 7f54be8 + 262107a commit e2df8d5

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

config/webpack.common.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ const common = {
1717
// the filename template for entry chunks
1818
filename: '[name].js',
1919
},
20-
devtool: 'source-map',
2120
stats: {
2221
all: false,
2322
errors: true,

templates/devtools/config/webpack.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ const common = require('./webpack.common.js');
66
const PATHS = require('./paths');
77

88
// Merge webpack configuration files
9-
const config = merge(common, {
9+
const config = (env, argv) => merge(common, {
1010
entry: {
1111
devtools: PATHS.src + '/devtools.js',
1212
panel: PATHS.src + '/panel.js',
1313
background: PATHS.src + '/background.js',
1414
},
15+
devtool: argv.mode === 'production' ? false : 'source-map'
1516
});
1617

1718
module.exports = config;

templates/override-page/config/webpack.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ const common = require('./webpack.common.js');
66
const PATHS = require('./paths');
77

88
// Merge webpack configuration files
9-
const config = merge(common, {
9+
const config = (env, argv) => merge(common, {
1010
entry: {
1111
app: PATHS.src + '/app.js',
1212
background: PATHS.src + '/background.js',
1313
},
14+
devtool: argv.mode === 'production' ? false : 'source-map'
1415
});
1516

1617
module.exports = config;

templates/popup/config/webpack.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ const common = require('./webpack.common.js');
66
const PATHS = require('./paths');
77

88
// Merge webpack configuration files
9-
const config = merge(common, {
9+
const config = (env, argv) => merge(common, {
1010
entry: {
1111
popup: PATHS.src + '/popup.js',
1212
contentScript: PATHS.src + '/contentScript.js',
1313
background: PATHS.src + '/background.js',
1414
},
15+
devtool: argv.mode === 'production' ? false : 'source-map'
1516
});
1617

1718
module.exports = config;

0 commit comments

Comments
 (0)