Skip to content

Commit 12b4834

Browse files
committed
dynamic sourcemaps
1 parent ab85f16 commit 12b4834

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

webpack.config.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
var _ = require('underscore');
22
var path = require('path');
3+
var sourcemaps = 'source-map'
34

5+
if(process.argv.indexOf('-w') !== -1 || process.argv.indexOf('-w') !== -1 ){
6+
console.log('watch mode detected, will switch to cheep sourcemaps')
7+
sourcemaps = 'eval-source-map';
8+
9+
}
410
var commonConfig = {
511
resolve: {
612
root: [
@@ -44,7 +50,7 @@ function buildConfig(appName) {
4450
filename: 'main.min.js',
4551
path: './notebook/static/' + appName + '/js/built'
4652
},
47-
devtool: 'eval-source-map',
53+
devtool: sourcemaps,
4854
});
4955
}
5056

@@ -61,7 +67,7 @@ module.exports = [
6167
path: './notebook/static/services/built',
6268
libraryTarget: 'amd'
6369
},
64-
devtool: 'eval-source-map',
70+
devtool: sourcemaps,
6571
}),
6672
_.extend({}, commonConfig, {
6773
entry: './notebook/static/index.js',
@@ -70,6 +76,6 @@ module.exports = [
7076
path: './notebook/static/built',
7177
libraryTarget: 'amd'
7278
},
73-
devtool: 'eval-source-map',
79+
devtool: sourcemaps,
7480
}),
7581
].map(buildConfig);

0 commit comments

Comments
 (0)