Skip to content

Commit

Permalink
dynamic sourcemaps
Browse files Browse the repository at this point in the history
  • Loading branch information
Carreau committed Apr 21, 2016
1 parent ab85f16 commit 12b4834
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
var _ = require('underscore');
var path = require('path');
var sourcemaps = 'source-map'

if(process.argv.indexOf('-w') !== -1 || process.argv.indexOf('-w') !== -1 ){
console.log('watch mode detected, will switch to cheep sourcemaps')
sourcemaps = 'eval-source-map';

}
var commonConfig = {
resolve: {
root: [
Expand Down Expand Up @@ -44,7 +50,7 @@ function buildConfig(appName) {
filename: 'main.min.js',
path: './notebook/static/' + appName + '/js/built'
},
devtool: 'eval-source-map',
devtool: sourcemaps,
});
}

Expand All @@ -61,7 +67,7 @@ module.exports = [
path: './notebook/static/services/built',
libraryTarget: 'amd'
},
devtool: 'eval-source-map',
devtool: sourcemaps,
}),
_.extend({}, commonConfig, {
entry: './notebook/static/index.js',
Expand All @@ -70,6 +76,6 @@ module.exports = [
path: './notebook/static/built',
libraryTarget: 'amd'
},
devtool: 'eval-source-map',
devtool: sourcemaps,
}),
].map(buildConfig);

0 comments on commit 12b4834

Please sign in to comment.