diff --git a/gulpfile.js b/gulpfile.js index 106748b8ab..062bf62c06 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -62,6 +62,10 @@ var paths = { ] }; +var webpackOptions = { + devtool: 'inline-source-map' +}; + function errorHandler() { var args = Array.prototype.slice.call(arguments); @@ -87,14 +91,22 @@ gulp.task('inject', function() { gulp.task('pack-client', function() { return gulp.src(webpackConfig.entry) .pipe(plumber({ errorHandler })) - .pipe(webpack(webpackConfig)) + .pipe(webpack(Object.assign( + {}, + webpackConfig, + webpackOptions + ))) .pipe(gulp.dest(webpackConfig.output.path)); }); gulp.task('pack-watch', function() { return gulp.src(webpackConfig.entry) .pipe(plumber({ errorHandler })) - .pipe(webpack(Object.assign(webpackConfig, { watch: true }))) + .pipe(webpack(Object.assign( + {}, + webpackConfig, + { watch: true } + ))) .pipe(gulp.dest(webpackConfig.output.path)); }); diff --git a/package.json b/package.json index 675336c28f..cdd8ffc38b 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,9 @@ "url": "https://github.com/freecodecamp/freecodecamp.git" }, "scripts": { + "build-production": "webpack", "start": "babel-node server/server.js", - "prestart-production": "bower cache clean && bower install && gulp build", + "prestart-production": "bower cache clean && bower install && gulp build && npm run build-production", "start-production": "node pm2Start", "lint": "eslint --ext=.js,.jsx .", "test": "mocha" diff --git a/webpack.config.js b/webpack.config.js index 68091d74e5..83121c4c8e 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,7 +1,6 @@ var path = require('path'); module.exports = { - devtool: 'inline-source-map', entry: './client', output: { filename: 'bundle.js',