mirror of
https://github.com/projectstorm/react-diagrams.git
synced 2026-03-13 09:50:09 +08:00
really really fix source maps -_-
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user