Skip to content

Commit

Permalink
🔧 Use webpackbar in antd-tools and bisheng
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Nov 10, 2018
1 parent 8900c5e commit 4647d46
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 40 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
20 changes: 0 additions & 20 deletions site/bisheng.config.js
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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: {
Expand Down Expand Up @@ -131,7 +112,6 @@ module.exports = {
}

alertBabelConfig(config.module.rules);
usePrettyWebpackBar(config);

config.plugins.push(
new CSSSplitWebpackPlugin({ size: 4000 }),
Expand Down
19 changes: 0 additions & 19 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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);
});
}

Expand Down

0 comments on commit 4647d46

Please sign in to comment.