|
1 | 1 | import { getProjectPath, resolve } from './utils/projectHelper'; |
2 | 2 | import * as path from 'path'; |
3 | 3 | import * as webpack from 'webpack'; |
4 | | -import WebpackBar from 'webpackbar'; |
5 | 4 | import webpackMerge from 'webpack-merge'; |
6 | 5 | import MiniCssExtractPlugin from 'mini-css-extract-plugin'; |
7 | 6 | import CssMinimizerPlugin from 'css-minimizer-webpack-plugin'; |
@@ -35,33 +34,6 @@ interface GetWebpackConfigFunction { |
35 | 34 | imageOptions: typeof imageOptions; |
36 | 35 | } |
37 | 36 |
|
38 | | -const shouldFallbackToNativeProgressPlugin = () => { |
39 | | - const [major = 0, minor = 0] = webpack.version |
40 | | - .split('.') |
41 | | - .map((version) => Number.parseInt(version, 10)); |
42 | | - |
43 | | - return major > 5 || (major === 5 && minor >= 106); |
44 | | -}; |
45 | | - |
46 | | -class CompatibleProgressPlugin { |
47 | | - private readonly plugin: { apply(compiler: webpack.Compiler): void }; |
48 | | - |
49 | | - constructor() { |
50 | | - this.plugin = shouldFallbackToNativeProgressPlugin() |
51 | | - ? new webpack.ProgressPlugin({ |
52 | | - activeModules: true, |
53 | | - }) |
54 | | - : new WebpackBar({ |
55 | | - name: '🚚 Ant Design Tools', |
56 | | - color: '#2f54eb', |
57 | | - }); |
58 | | - } |
59 | | - |
60 | | - apply(compiler: webpack.Compiler) { |
61 | | - this.plugin.apply(compiler); |
62 | | - } |
63 | | -} |
64 | | - |
65 | 37 | const getWebpackConfig: GetWebpackConfigFunction = (modules, options = {}) => { |
66 | 38 | const { enabledReactCompiler } = options; |
67 | 39 |
|
@@ -206,7 +178,9 @@ ${pkg.name} v${pkg.version} |
206 | 178 | Copyright 2015-present, Alipay, Inc. |
207 | 179 | All rights reserved. |
208 | 180 | `), |
209 | | - new CompatibleProgressPlugin(), |
| 181 | + new webpack.ProgressPlugin({ |
| 182 | + activeModules: true, |
| 183 | + }), |
210 | 184 | new CleanUpStatsPlugin(), |
211 | 185 | ], |
212 | 186 |
|
|
0 commit comments