Commit f47357fc authored by ioedeveloper's avatar ioedeveloper Committed by yann300

Enable react production build

parent 604b62b0
const nxWebpack = require('@nrwl/react/plugins/webpack') const nxWebpack = require('@nrwl/react/plugins/webpack')
const TerserPlugin = require('terser-webpack-plugin')
module.exports = config => { module.exports = config => {
const nxWebpackConfig = nxWebpack(config) const nxWebpackConfig = nxWebpack(config)
const productionConfig = process.env.NODE_ENV === 'production' ? {
mode: 'production',
devtool: 'source-map',
optimization: {
minimize: true,
minimizer: [new TerserPlugin()]
}
} : {}
return { return {
...nxWebpackConfig, ...nxWebpackConfig,
node: { ...productionConfig,
fs: 'empty', node: {
tls: 'empty', fs: 'empty',
readline: 'empty', tls: 'empty',
net: 'empty', readline: 'empty',
module: 'empty', net: 'empty',
child_process: 'empty' module: 'empty',
} child_process: 'empty'
} }
}
} }
const nxWebpack = require('@nrwl/react/plugins/webpack') const nxWebpack = require('@nrwl/react/plugins/webpack')
const TerserPlugin = require('terser-webpack-plugin')
module.exports = config => { module.exports = config => {
const nxWebpackConfig = nxWebpack(config) const nxWebpackConfig = nxWebpack(config)
const productionConfig = process.env.NODE_ENV === 'production' ? {
mode: 'production',
devtool: 'source-map',
optimization: {
minimize: true,
minimizer: [new TerserPlugin()]
}
} : {}
return { return {
...nxWebpackConfig, ...nxWebpackConfig,
node: { ...productionConfig,
fs: 'empty', node: {
tls: 'empty', fs: 'empty',
readline: 'empty', tls: 'empty',
net: 'empty', readline: 'empty',
module: 'empty', net: 'empty',
child_process: 'empty' module: 'empty',
} child_process: 'empty'
} }
}
} }
This diff is collapsed.
...@@ -285,6 +285,7 @@ ...@@ -285,6 +285,7 @@
"swarmgw": "^0.3.1", "swarmgw": "^0.3.1",
"tap-spec": "^5.0.0", "tap-spec": "^5.0.0",
"tape": "^4.13.3", "tape": "^4.13.3",
"terser-webpack-plugin": "^4.2.3",
"ts-jest": "25.2.1", "ts-jest": "25.2.1",
"ts-node": "^7.0.1", "ts-node": "^7.0.1",
"tslint": "~6.0.0", "tslint": "~6.0.0",
......
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