|
@ -1,8 +1,6 @@ |
|
|
const path = require('path'); |
|
|
const path = require('path'); |
|
|
const CSSSplitWebpackPlugin = require('css-split-webpack-plugin').default; |
|
|
const CSSSplitWebpackPlugin = require('css-split-webpack-plugin').default; |
|
|
const replaceLib = require('antd-tools/lib/replaceLib'); |
|
|
const replaceLib = require('antd-tools/lib/replaceLib'); |
|
|
const webpack = require('webpack'); |
|
|
|
|
|
const WebpackBar = require('webpackbar'); |
|
|
|
|
|
|
|
|
|
|
|
const isDev = process.env.NODE_ENV === 'development'; |
|
|
const isDev = process.env.NODE_ENV === 'development'; |
|
|
const usePreact = process.env.REACT_ENV === 'preact'; |
|
|
const usePreact = process.env.REACT_ENV === 'preact'; |
|
@ -22,23 +20,6 @@ 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: '📦 Ant Design Site', |
|
|
|
|
|
minimal: false, |
|
|
|
|
|
}) |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
module.exports = { |
|
|
module.exports = { |
|
|
port: 8001, |
|
|
port: 8001, |
|
|
source: { |
|
|
source: { |
|
@ -131,7 +112,6 @@ 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 }), |
|
|