Commit 89f2717a authored by gxkai's avatar gxkai

build: 加入打包进度插件

parent e02990d4
const nxWebpack = require('@nrwl/react/plugins/webpack')
const TerserPlugin = require('terser-webpack-plugin')
const webpack = require('webpack')
const WebpackBar = require('webpackbar')
module.exports = config => {
const nxWebpackConfig = nxWebpack(config)
const webpackConfig = {
......@@ -12,8 +13,9 @@ module.exports = config => {
net: 'empty',
module: 'empty',
child_process: 'empty'
},
}
}
webpackConfig.plugins.push(new WebpackBar())
// webpackConfig.resolve.alias = {
// ...webpackConfig.resolve.alias,
// 'fs': 'browserfs/dist/shims/fs.js',
......@@ -37,12 +39,12 @@ module.exports = config => {
// }),)
return {
...webpackConfig,
// mode: 'production',
devtool: 'nosources-cheap-module-source-map'
// optimization: {
// minimize: true,
// minimizer: [new TerserPlugin()]
// }
mode: 'production',
// devtool: 'nosources-cheap-module-source-map',
optimization: {
minimize: true,
minimizer: [new TerserPlugin()]
}
}
} else {
return webpackConfig
......
......@@ -291,6 +291,7 @@
"typescript": "^4.4.3",
"uglify-js": "^2.8.16",
"watchify": "^3.9.0",
"webpackbar": "^5.0.2",
"webworkify-webpack": "^2.1.5",
"worker-loader": "^2.0.0",
"yo-yoify": "^4.3.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