mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-27 12:39:49 +08:00
🔧 Use webpackbar in antd-tools and bisheng
This commit is contained in:
parent
8900c5e817
commit
4647d46c22
@ -174,7 +174,6 @@
|
||||
"typescript": "~3.1.1",
|
||||
"unified": "^7.0.0",
|
||||
"values.js": "^1.0.3",
|
||||
"webpackbar": "^3.1.2",
|
||||
"xhr-mock": "^2.4.1",
|
||||
"xhr2": "^0.1.4"
|
||||
},
|
||||
|
@ -1,8 +1,6 @@
|
||||
const path = require('path');
|
||||
const CSSSplitWebpackPlugin = require('css-split-webpack-plugin').default;
|
||||
const replaceLib = require('antd-tools/lib/replaceLib');
|
||||
const webpack = require('webpack');
|
||||
const WebpackBar = require('webpackbar');
|
||||
|
||||
const isDev = process.env.NODE_ENV === 'development';
|
||||
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 = {
|
||||
port: 8001,
|
||||
source: {
|
||||
@ -131,7 +112,6 @@ module.exports = {
|
||||
}
|
||||
|
||||
alertBabelConfig(config.module.rules);
|
||||
usePrettyWebpackBar(config);
|
||||
|
||||
config.plugins.push(
|
||||
new CSSSplitWebpackPlugin({ size: 4000 }),
|
||||
|
@ -1,7 +1,6 @@
|
||||
// This config is for building dist files
|
||||
const webpack = require('webpack');
|
||||
const getWebpackConfig = require('antd-tools/lib/getWebpackConfig');
|
||||
const WebpackBar = require('webpackbar');
|
||||
|
||||
// noParse still leave `require('./locale' + name)` in dist files
|
||||
// ignore is better
|
||||
@ -29,30 +28,12 @@ function externalMoment(config) {
|
||||
};
|
||||
}
|
||||
|
||||
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: '📦 Webpack',
|
||||
minimal: false,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
const webpackConfig = getWebpackConfig(false);
|
||||
if (process.env.RUN_ENV === 'PRODUCTION') {
|
||||
webpackConfig.forEach((config) => {
|
||||
ignoreMomentLocale(config);
|
||||
externalMoment(config);
|
||||
addLocales(config);
|
||||
usePrettyWebpackBar(config);
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user