config webpack for compiler

pull/1658/head
filip mertens 3 years ago committed by yann300
parent 785ada4567
commit 333b0e60eb
  1. 18
      apps/solidity-compiler/webpack.config.js

@ -1,9 +1,9 @@
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
}
}

Loading…
Cancel
Save