File tree 3 files changed +35
-4
lines changed
3 files changed +35
-4
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * Copyright (c) 2015-present, Facebook, Inc.
3
+ * All rights reserved.
4
+ *
5
+ * This source code is licensed under the BSD-style license found in the
6
+ * LICENSE file in the root directory of this source tree. An additional grant
7
+ * of patent rights can be found in the PATENTS file in the same directory.
8
+ */
9
+
10
+ 'use strict' ;
11
+
12
+ const ProgressPlugin = require ( 'webpack' ) . ProgressPlugin ;
13
+ const ProgressBar = require ( 'progress' ) ;
14
+ const chalk = require ( 'chalk' ) ;
15
+
16
+ function BuildProgressPlugin ( ) {
17
+ const bar = new ProgressBar ( ` [:bar] ${ chalk . bold ( ':percent' ) } ${ chalk . yellow ( ':etas' ) } (${ chalk . dim ( ':msg' ) } )` , {
18
+ total : 100 ,
19
+ complete : '=' ,
20
+ incomplete : ' ' ,
21
+ width : 25
22
+ } )
23
+ return new ProgressPlugin ( function ( percent , msg ) {
24
+ if ( percent === 1 ) msg = 'completed' ;
25
+ bar . update ( percent , { msg : msg } ) ;
26
+ if ( percent === 1 ) bar . terminate ( ) ;
27
+ } ) ;
28
+ }
29
+
30
+ module . exports = BuildProgressPlugin ;
Original file line number Diff line number Diff line change 27
27
"escape-string-regexp" : " 1.0.5" ,
28
28
"html-entities" : " 1.2.0" ,
29
29
"opn" : " 4.0.2" ,
30
+ "progress" : " 1.1.8" ,
30
31
"sockjs-client" : " 1.0.3" ,
31
- "strip-ansi" : " 3.0.1"
32
- },
33
- "peerDependencies" : {
32
+ "strip-ansi" : " 3.0.1" ,
34
33
"webpack" : " ^1.13.2"
35
34
}
36
35
}
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ var InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
19
19
var url = require ( 'url' ) ;
20
20
var paths = require ( './paths' ) ;
21
21
var getClientEnvironment = require ( './env' ) ;
22
+ var BuildProgressPlugin = require ( 'react-dev-utils/BuildProgressPlugin' ) ;
22
23
23
24
function ensureSlash ( path , needsSlash ) {
24
25
var hasSlash = path . endsWith ( '/' ) ;
@@ -257,7 +258,8 @@ module.exports = {
257
258
// having to parse `index.html`.
258
259
new ManifestPlugin ( {
259
260
fileName : 'asset-manifest.json'
260
- } )
261
+ } ) ,
262
+ new BuildProgressPlugin ( )
261
263
] ,
262
264
// Some libraries import Node modules but don't use them in the browser.
263
265
// Tell Webpack to provide empty mocks for them so importing them works.
You can’t perform that action at this time.
0 commit comments