From 12b48343cbfbd61ec1dd521325666a1022922acb Mon Sep 17 00:00:00 2001 From: Matthias Bussonnier Date: Thu, 21 Apr 2016 17:46:03 +0200 Subject: [PATCH] dynamic sourcemaps --- webpack.config.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index 29a068eae..c1ccdbaae 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -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: [ @@ -44,7 +50,7 @@ function buildConfig(appName) { filename: 'main.min.js', path: './notebook/static/' + appName + '/js/built' }, - devtool: 'eval-source-map', + devtool: sourcemaps, }); } @@ -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', @@ -70,6 +76,6 @@ module.exports = [ path: './notebook/static/built', libraryTarget: 'amd' }, - devtool: 'eval-source-map', + devtool: sourcemaps, }), ].map(buildConfig);