File tree Expand file tree Collapse file tree 6 files changed +15
-15
lines changed Expand file tree Collapse file tree 6 files changed +15
-15
lines changed Original file line number Diff line number Diff line change 52
52
"eslint-plugin-react" : " ^7.7.0" ,
53
53
"file-loader" : " ^1.1.11" ,
54
54
"fs-extra" : " ^5.0.0" ,
55
- "gh-pages" : " ^1.1 .0" ,
55
+ "gh-pages" : " ^1.2 .0" ,
56
56
"highlight.js" : " ^9.12.0" ,
57
57
"html-webpack-plugin" : " ^3.2.0" ,
58
58
"less" : " ^3.0.2" ,
62
62
"optimize-css-assets-webpack-plugin" : " ^4.0.0" ,
63
63
"postcss-flexbugs-fixes" : " ^3.2.0" ,
64
64
"postcss-loader" : " ^2.0.9" ,
65
+ "progress-bar-webpack-plugin" : " ^1.11.0" ,
65
66
"raw-content-replace-loader" : " ^1.0.1" ,
66
67
"raw-extend-loader" : " ^1.0.5" ,
67
68
"raw-tree-replace-loader" : " ^1.1.0" ,
78
79
"style-loader" : " ^0.19.1" ,
79
80
"upath" : " ^1.0.2" ,
80
81
"url-replace-loader" : " ^1.0.0" ,
81
- "webpack" : " ^4.8.1 " ,
82
- "webpack-cli" : " ^2.1.3 " ,
82
+ "webpack" : " ^4.10.2 " ,
83
+ "webpack-cli" : " ^3.0.1 " ,
83
84
"webpack-dev-middleware" : " ^3.1.3" ,
84
85
"webpack-dev-server" : " ^3.1.4" ,
85
86
"webpack-hot-dev-clients" : " ^1.0.4" ,
Original file line number Diff line number Diff line change 1
1
const webpack = require ( 'webpack' ) ;
2
- const load = require ( 'loading-cli' ) ;
3
2
const conf = require ( './conf/webpack.config.prod' ) ;
4
3
require ( 'colors-cli/toxic' ) ;
5
4
6
5
module . exports = function serve ( program ) {
7
- const loading = load ( 'Compiler is running...' . green ) . start ( ) ;
8
- loading . color = 'green' ;
9
-
10
6
const webpackConf = conf ( program ) ;
11
7
const compiler = webpack ( webpackConf ) ;
12
8
compiler . run ( ( err , stats ) => {
13
- loading . stop ( ) ;
14
9
// 官方输出参数
15
10
// https://webpack.js.org/configuration/stats/
16
11
// https://github.com/webpack/webpack/issues/538#issuecomment-59586196
Original file line number Diff line number Diff line change @@ -27,7 +27,8 @@ module.exports = function (cmd) {
27
27
loaders . push ( {
28
28
// Process JS with Babel.
29
29
test : / \. ( j s | j s x | m j s ) $ / ,
30
- exclude : paths . getExcludeFoldersRegExp . concat ( / \. ( c a c h e ) / ) ,
30
+ // exclude: paths.getExcludeFoldersRegExp.concat(/\.(cache)/),
31
+ exclude : / n o d e _ m o d u l e s / ,
31
32
use : [
32
33
{
33
34
loader : require . resolve ( 'string-replace-loader' ) ,
@@ -106,7 +107,7 @@ module.exports = function (cmd) {
106
107
} ) ;
107
108
108
109
config . plugins = config . plugins . concat ( [
109
- // new webpack.HotModuleReplacementPlugin(),
110
+ new webpack . HotModuleReplacementPlugin ( ) ,
110
111
new HtmlWebpackPlugin ( {
111
112
inject : true ,
112
113
favicon : paths . defaultFaviconPath ,
Original file line number Diff line number Diff line change 1
1
const PATH = require ( 'path' ) ;
2
+ const ProgressBarPlugin = require ( 'progress-bar-webpack-plugin' ) ;
2
3
const paths = require ( './path' ) ;
3
4
4
5
module . exports = {
@@ -78,7 +79,12 @@ module.exports = {
78
79
} ,
79
80
] ,
80
81
} ,
81
- plugins : [ ] ,
82
+ plugins : [
83
+ new ProgressBarPlugin ( {
84
+ format : ` build [:bar] ${ ':percent' . green } (:elapsed seconds)` ,
85
+ clear : false ,
86
+ } ) ,
87
+ ] ,
82
88
node : {
83
89
dgram : 'empty' ,
84
90
fs : 'empty' ,
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ const webpack = require('webpack');
2
2
const WebpackDevServer = require ( 'webpack-dev-server' ) ;
3
3
const opn = require ( 'opn' ) ;
4
4
const detect = require ( 'detect-port' ) ;
5
- const load = require ( 'loading-cli' ) ;
6
5
const conf = require ( './conf/webpack.config.dev' ) ;
7
6
const createDevServerConfig = require ( './conf/webpack.config.server' ) ;
8
7
require ( 'colors-cli/toxic' ) ;
@@ -12,13 +11,10 @@ module.exports = function server(cmd) {
12
11
let DEFAULT_PORT = cmd . port ;
13
12
const webpackConf = conf ( cmd ) ;
14
13
const compiler = webpack ( webpackConf ) ;
15
- const loading = load ( 'Compiler is running...' . green ) . start ( ) ;
16
- loading . color = 'green' ;
17
14
18
15
// https://webpack.js.org/api/compiler-hooks/#aftercompile
19
16
// 编译完成之后打印日志
20
17
compiler . hooks . done . tap ( 'done' , ( ) => {
21
- loading . stop ( ) ;
22
18
// eslint-disable-next-line
23
19
console . log ( `\nDev Server Listening at ${ `http://${ HOST } :${ DEFAULT_PORT } ` . green } ` ) ;
24
20
} ) ;
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import ReactDOM from 'react-dom' ;
3
+ import 'babel-polyfill' ;
3
4
import RouterRoot from './Router' ;
4
5
5
6
ReactDOM . render (
You can’t perform that action at this time.
0 commit comments