Commit 89f2717a authored by gxkai's avatar gxkai

build: 加入打包进度插件

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