File tree Expand file tree Collapse file tree 3 files changed +32
-1
lines changed Expand file tree Collapse file tree 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 1111 "node" : " >=4"
1212 },
1313 "files" : [
14+ " BuildProgressPlugin.js" ,
1415 " clearConsole.js" ,
1516 " checkRequiredFiles.js" ,
1617 " formatWebpackMessages.js" ,
2829 "escape-string-regexp" : " 1.0.5" ,
2930 "html-entities" : " 1.2.0" ,
3031 "opn" : " 4.0.2" ,
32+ "progress" : " 1.1.8" ,
3133 "sockjs-client" : " 1.0.1" ,
3234 "strip-ansi" : " 3.0.1"
35+ },
36+ "devDependencies" : {
37+ "webpack" : " ^1.14.0"
3338 }
3439}
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ var InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
1818var url = require ( 'url' ) ;
1919var paths = require ( './paths' ) ;
2020var getClientEnvironment = require ( './env' ) ;
21+ var BuildProgressPlugin = require ( 'react-dev-utils/BuildProgressPlugin' ) ;
2122
2223// @remove -on-eject-begin
2324// `path` is not used after eject - see https://github.com/facebookincubator/create-react-app/issues/1174
@@ -268,7 +269,9 @@ module.exports = {
268269 // having to parse `index.html`.
269270 new ManifestPlugin ( {
270271 fileName : 'asset-manifest.json'
271- } )
272+ } ) ,
273+ // Displays a progress bar during the build
274+ new BuildProgressPlugin ( )
272275 ] ,
273276 // Some libraries import Node modules but don't use them in the browser.
274277 // Tell Webpack to provide empty mocks for them so importing them works.
You can’t perform that action at this time.
0 commit comments