From 5f5f13a81867f7eff249d4e21bc5835c51e91b42 Mon Sep 17 00:00:00 2001 From: Dylan Vorster Date: Sat, 10 Mar 2018 15:52:30 +0200 Subject: [PATCH] really really fix source maps -_- --- webpack.config.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index 6e7bc06..b4cc57c 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,9 +1,10 @@ const webpack = require("webpack"); const UglifyJsPlugin = require('uglifyjs-webpack-plugin') var plugins = []; +const production = process.env.NODE_ENV === 'production'; //do we minify it all -if(process.env.NODE_ENV === 'production'){ +if (production) { console.log("creating production build"); plugins.push(new webpack.DefinePlugin({ 'process.env.NODE_ENV': 'production', @@ -43,7 +44,7 @@ module.exports = root: '_' } }, - plugins:plugins, + plugins: plugins, module: { rules: [ { @@ -60,8 +61,8 @@ module.exports = resolve: { extensions: [".tsx", ".ts", ".js"] }, - devtool: 'cheap-module-source-map', - mode: process.env.NODE_ENV || 'development', + devtool: production ? 'source-map' : 'cheap-module-source-map', + mode: production ? 'production' : 'development', optimization: { minimizer: [ // we specify a custom UglifyJsPlugin here to get source maps in production