|
@ -2,6 +2,8 @@ const path = require('path'); |
|
|
const CSSSplitWebpackPlugin = require('css-split-webpack-plugin').default; |
|
|
const CSSSplitWebpackPlugin = require('css-split-webpack-plugin').default; |
|
|
const OfflinePlugin = require('@yesmeck/offline-plugin'); |
|
|
const OfflinePlugin = require('@yesmeck/offline-plugin'); |
|
|
const replaceLib = require('antd-tools/lib/replaceLib'); |
|
|
const replaceLib = require('antd-tools/lib/replaceLib'); |
|
|
|
|
|
const webpack = require('webpack'); |
|
|
|
|
|
const WebpackBar = require('webpackbar'); |
|
|
const getExternalResources = require('./getExternalResources'); |
|
|
const getExternalResources = require('./getExternalResources'); |
|
|
|
|
|
|
|
|
const isDev = process.env.NODE_ENV === 'development'; |
|
|
const isDev = process.env.NODE_ENV === 'development'; |
|
@ -22,6 +24,23 @@ function alertBabelConfig(rules) { |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function usePrettyWebpackBar(config) { |
|
|
|
|
|
// remove old progress plugin.
|
|
|
|
|
|
config.plugins = config.plugins |
|
|
|
|
|
.filter((plugin) => { |
|
|
|
|
|
return !(plugin instanceof webpack.ProgressPlugin) |
|
|
|
|
|
&& !(plugin instanceof WebpackBar); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// use brand new progress bar.
|
|
|
|
|
|
config.plugins.push( |
|
|
|
|
|
new WebpackBar({ |
|
|
|
|
|
name: '📦 Site', |
|
|
|
|
|
minimal: false, |
|
|
|
|
|
}) |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
module.exports = { |
|
|
module.exports = { |
|
|
port: 8001, |
|
|
port: 8001, |
|
|
source: { |
|
|
source: { |
|
@ -109,6 +128,7 @@ module.exports = { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
alertBabelConfig(config.module.rules); |
|
|
alertBabelConfig(config.module.rules); |
|
|
|
|
|
usePrettyWebpackBar(config); |
|
|
|
|
|
|
|
|
config.plugins.push( |
|
|
config.plugins.push( |
|
|
new CSSSplitWebpackPlugin({ size: 4000 }), |
|
|
new CSSSplitWebpackPlugin({ size: 4000 }), |
|
|