@@ -7,10 +7,12 @@ import _ from "lodash";
7
7
import { r , urlJoin } from "@nuxt/common" ;
8
8
import consola from "consola" ;
9
9
import chokidar from "chokidar" ;
10
+ import env from "std-env" ;
10
11
import pify from "pify" ;
11
12
import webpack from "webpack" ;
12
13
import webpackDevMiddleware from "webpack-dev-middleware" ;
13
14
import webpackHotMiddleware from "webpack-hot-middleware" ;
15
+ import WebpackBar from "webpackbar" ;
14
16
import serveStatic from "serve-static" ;
15
17
16
18
import pkg from "../package.json" ;
@@ -64,6 +66,34 @@ export default function NetlifyCmsModule(moduleOptions) {
64
66
}
65
67
} ) ;
66
68
69
+ webpackConfig . plugins . push (
70
+ new WebpackBar ( {
71
+ name : WEBPACK_NETLIFY_COMPILER_NAME ,
72
+ color : "red" ,
73
+ reporters : [ "basic" , "fancy" , "profile" , "stats" ] ,
74
+ basic : ! this . options . build . quiet && env . minimalCLI ,
75
+ fancy : ! this . options . build . quiet && ! env . minimalCLI ,
76
+ profile : ! this . options . build . quiet && this . options . build . profile ,
77
+ stats :
78
+ ! this . options . build . quiet &&
79
+ ! this . options . dev &&
80
+ this . options . build . stats ,
81
+ reporter : {
82
+ change : ( _ , { shortPath } ) => {
83
+ this . nuxt . callHook ( "bundler:change" , shortPath ) ;
84
+ } ,
85
+ done : context => {
86
+ if ( context . hasErrors ) {
87
+ this . nuxt . callHook ( "bundler:error" ) ;
88
+ }
89
+ } ,
90
+ allDone : ( ) => {
91
+ this . nuxt . callHook ( "bundler:done" ) ;
92
+ }
93
+ }
94
+ } )
95
+ ) ;
96
+
67
97
const netlifyCompiler = webpack ( webpackConfig ) ;
68
98
69
99
// This will be run just before webpack compiler starts
@@ -84,7 +114,6 @@ export default function NetlifyCmsModule(moduleOptions) {
84
114
return ;
85
115
}
86
116
87
- logger . success ( "Netlify-cms bundle generated" ) ;
88
117
// Show a message inside console when the build is ready
89
118
this . options . dev &&
90
119
logger . info ( `Netlify-cms served on: ${ config . adminPath } ` ) ;
@@ -102,12 +131,14 @@ export default function NetlifyCmsModule(moduleOptions) {
102
131
const netlifyWebpackDevMiddleware = pify (
103
132
webpackDevMiddleware ( netlifyCompiler , {
104
133
publicPath : "/" ,
105
- stats : builder . webpackStats ,
106
- noInfo : true ,
107
- quiet : true ,
134
+ stats : false ,
135
+ logLevel : "silent" ,
108
136
watchOptions : this . options . watchers . webpack
109
137
} )
110
138
) ;
139
+ netlifyWebpackDevMiddleware . close = pify (
140
+ netlifyWebpackDevMiddleware . close
141
+ ) ;
111
142
112
143
// Create webpack hot middleware
113
144
const netlifyWebpackHotMiddleware = pify (
0 commit comments