File tree 3 files changed +32
-1
lines changed
3 files changed +32
-1
lines changed Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+
3
+ const path = require ( 'path' ) ;
4
+
5
+ const ProgressPlugin = require ( 'webpack' ) . ProgressPlugin ;
6
+ const ProgressBar = require ( 'progress' ) ;
7
+ const chalk = require ( 'chalk' ) ;
8
+
9
+ function BuildProgressPlugin ( ) {
10
+ const bar = new ProgressBar ( ` [:bar] ${ chalk . bold ( ':percent' ) } ${ chalk . yellow ( ':etas' ) } (${ chalk . dim ( ':msg' ) } )` , {
11
+ total : 100 ,
12
+ complete : '=' ,
13
+ incomplete : ' ' ,
14
+ width : 25
15
+ } ) ;
16
+ return new ProgressPlugin ( function ( percent , msg ) {
17
+ if ( percent === 1 ) msg = 'completed' ;
18
+ bar . update ( percent , { msg } ) ;
19
+ if ( percent === 1 ) bar . terminate ( ) ;
20
+ } ) ;
21
+ }
22
+
23
+ module . exports = BuildProgressPlugin ;
Original file line number Diff line number Diff line change 11
11
"node" : " >=4"
12
12
},
13
13
"files" : [
14
+ " BuildProgressPlugin.js" ,
14
15
" clearConsole.js" ,
15
16
" checkRequiredFiles.js" ,
16
17
" formatWebpackMessages.js" ,
28
29
"escape-string-regexp" : " 1.0.5" ,
29
30
"html-entities" : " 1.2.0" ,
30
31
"opn" : " 4.0.2" ,
32
+ "progress" : " 1.1.8" ,
31
33
"sockjs-client" : " 1.0.1" ,
32
34
"strip-ansi" : " 3.0.1"
35
+ },
36
+ "devDependencies" : {
37
+ "webpack" : " ^1.14.0"
33
38
}
34
39
}
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ var InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
18
18
var url = require ( 'url' ) ;
19
19
var paths = require ( './paths' ) ;
20
20
var getClientEnvironment = require ( './env' ) ;
21
+ var BuildProgressPlugin = require ( 'react-dev-utils/BuildProgressPlugin' ) ;
21
22
22
23
// @remove -on-eject-begin
23
24
// `path` is not used after eject - see https://github.com/facebookincubator/create-react-app/issues/1174
@@ -268,7 +269,9 @@ module.exports = {
268
269
// having to parse `index.html`.
269
270
new ManifestPlugin ( {
270
271
fileName : 'asset-manifest.json'
271
- } )
272
+ } ) ,
273
+ // Displays a progress bar during the build
274
+ new BuildProgressPlugin ( )
272
275
] ,
273
276
// Some libraries import Node modules but don't use them in the browser.
274
277
// Tell Webpack to provide empty mocks for them so importing them works.
You can’t perform that action at this time.
0 commit comments