🔧 Use webpackbar in antd-tools and bisheng

This commit is contained in:
afc163 2018-11-10 12:42:11 +08:00
parent 8900c5e817
commit 4647d46c22
No known key found for this signature in database
GPG Key ID: 5F00908D72002306
3 changed files with 0 additions and 40 deletions

View File

@ -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"
},

View File

@ -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 }),

View File

@ -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);
});
}