commit
00223fe927
@ -1,17 +1,31 @@ |
|||||||
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 webpackConfig = { |
||||||
|
...nxWebpackConfig, |
||||||
|
node: { |
||||||
|
fs: 'empty', |
||||||
|
tls: 'empty', |
||||||
|
readline: 'empty', |
||||||
|
net: 'empty', |
||||||
|
module: 'empty', |
||||||
|
child_process: 'empty' |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if (process.env.NODE_ENV === 'production') { |
||||||
return { |
return { |
||||||
...nxWebpackConfig, |
...webpackConfig, |
||||||
node: { |
mode: 'production', |
||||||
fs: 'empty', |
devtool: 'source-map', |
||||||
tls: 'empty', |
optimization: { |
||||||
readline: 'empty', |
minimize: true, |
||||||
net: 'empty', |
minimizer: [new TerserPlugin()] |
||||||
module: 'empty', |
} |
||||||
child_process: 'empty' |
|
||||||
} |
|
||||||
} |
} |
||||||
|
} else { |
||||||
|
return webpackConfig |
||||||
|
} |
||||||
} |
} |
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue