File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed
Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,33 @@ const webpack = require('webpack')
88
99const { resolve } = require ( './utils' )
1010
11+ class BuildProgressPlugin {
12+ apply ( compiler ) {
13+ compiler . hooks . compile . tap ( 'BuildProgressPlugin' , ( ) => {
14+ console . log ( 'Webpack 正在编译...' )
15+ } )
16+
17+ compiler . hooks . compilation . tap ( 'BuildProgressPlugin' , ( ) => {
18+ console . log ( 'Webpack 正在创建编译内容...' )
19+ } )
20+
21+ compiler . hooks . emit . tapAsync (
22+ 'BuildProgressPlugin' ,
23+ ( compilation , callback ) => {
24+ console . log ( 'Webpack 正在生成资源...' )
25+ callback ( )
26+ }
27+ )
28+
29+ compiler . hooks . done . tap ( 'BuildProgressPlugin' , stats => {
30+ console . log ( 'Webpack 构建完成!' )
31+ if ( stats . hasErrors ( ) ) {
32+ console . error ( '构建过程中出现错误:' , stats . compilation . errors )
33+ }
34+ } )
35+ }
36+ }
37+
1138module . exports = function webpackConfigFn ( { reactVersion = '16' } ) {
1239 return {
1340 resolve : {
@@ -66,6 +93,7 @@ module.exports = function webpackConfigFn({ reactVersion = '16' }) {
6693 ]
6794 } ,
6895 plugins : [
96+ new BuildProgressPlugin ( ) ,
6997 // new (require('webpack-bundle-analyzer').BundleAnalyzerPlugin)({
7098 // analyzerPort: 4040
7199 // }),
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ import { VerifyCodeInput } from '../VerifyCodeInput'
1919import { IconFont } from '../../IconFont'
2020
2121import { MfaBusinessAction , useMfaBusinessRequest } from '../businessRequest'
22- import { useGuardPublicConfig } from 'src /_utils'
22+ import { useGuardPublicConfig } from '../.. /_utils'
2323
2424const { useRef } = React
2525
You can’t perform that action at this time.
0 commit comments