really really fix source maps -_-

This commit is contained in:
Dylan Vorster
2018-03-10 15:52:30 +02:00
parent 2b1a39f236
commit 5f5f13a818

View File

@@ -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