Commit 333b0e60 authored by filip mertens's avatar filip mertens Committed by yann300

config webpack for compiler

parent 785ada45
const nxWebpack = require('@nrwl/react/plugins/webpack')
const TerserPlugin = require('terser-webpack-plugin')
module.exports = config => {
const nxWebpackConfig = nxWebpack(config)
return {
const webpackConfig = {
...nxWebpackConfig,
node: {
fs: 'empty',
......@@ -14,4 +14,18 @@ module.exports = config => {
child_process: 'empty'
}
}
if (process.env.NODE_ENV === 'production') {
return {
...webpackConfig,
mode: 'production',
devtool: 'source-map',
optimization: {
minimize: true,
minimizer: [new TerserPlugin()]
}
}
} else {
return webpackConfig
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment