@@ -13,8 +13,6 @@ import { join, resolve, sep } from 'path'
13
13
import { isUrl } from './utils'
14
14
import clientWebpackConfig from './webpack/client.config.js'
15
15
import serverWebpackConfig from './webpack/server.config.js'
16
- import chalk from 'chalk'
17
- import PostCompilePlugin from 'post-compile-webpack-plugin'
18
16
const debug = require ( 'debug' ) ( 'nuxt:build' )
19
17
const remove = pify ( fs . remove )
20
18
const readFile = pify ( fs . readFile )
@@ -363,26 +361,11 @@ function getWebpackServerConfig () {
363
361
364
362
function createWebpackMiddleware ( ) {
365
363
const clientConfig = getWebpackClientConfig . call ( this )
366
- const host = process . env . HOST || '127.0.0.1'
367
- const port = process . env . PORT || '3000'
368
364
// setup on the fly compilation + hot-reload
369
365
clientConfig . entry . app = _ . flatten ( [ 'webpack-hot-middleware/client?reload=true' , clientConfig . entry . app ] )
370
366
clientConfig . plugins . push (
371
367
new webpack . HotModuleReplacementPlugin ( ) ,
372
- new webpack . NoEmitOnErrorsPlugin ( ) ,
373
- new PostCompilePlugin ( stats => {
374
- process . stdout . write ( '\x1Bc' )
375
- if ( stats . hasErrors ( ) || stats . hasWarnings ( ) ) {
376
- console . log ( stats . toString ( 'errors-only' ) ) // eslint-disable-line no-console
377
- console . log ( ) // eslint-disable-line no-console
378
- console . log ( chalk . bgRed . black ( ' ERROR ' ) , 'Compiling failed!' ) // eslint-disable-line no-console
379
- } else {
380
- console . log ( stats . toString ( webpackStats ) ) // eslint-disable-line no-console
381
- console . log ( chalk . bold ( `\n> Open http://${ host } :${ port } \n` ) ) // eslint-disable-line no-console
382
- console . log ( chalk . bgGreen . black ( ' DONE ' ) , 'Compiled successfully!' ) // eslint-disable-line no-console
383
- }
384
- console . log ( ) // eslint-disable-line no-console
385
- } )
368
+ new webpack . NoEmitOnErrorsPlugin ( )
386
369
)
387
370
const clientCompiler = webpack ( clientConfig )
388
371
// Add the middleware to the instance context
0 commit comments