feat: build.devMiddleware and build.hotMiddleware options

Closes #1025
This commit is contained in:
Pooya Parsa 2017-07-09 14:10:37 +04:30
parent 9e2c4b9761
commit 2a76ff4d27
2 changed files with 7 additions and 5 deletions

View File

@ -369,18 +369,18 @@ export default class Builder extends Tapable {
debug('Adding webpack middleware...')
// Create webpack dev middleware
this.webpackDevMiddleware = pify(webpackDevMiddleware(this.compiler.client, {
this.webpackDevMiddleware = pify(webpackDevMiddleware(this.compiler.client, Object.assign({
publicPath: this.options.build.publicPath,
stats: this.webpackStats,
noInfo: true,
quiet: true,
watchOptions: this.options.watchers.webpack
}))
}, this.options.build.devMiddleware)))
this.webpackHotMiddleware = pify(webpackHotMiddleware(this.compiler.client, {
this.webpackHotMiddleware = pify(webpackHotMiddleware(this.compiler.client, Object.assign({
log: false,
heartbeat: 2500
}))
}, this.options.build.hotMiddleware)))
// Inject to renderer instance
if (this.nuxt.renderer) {

View File

@ -69,7 +69,9 @@ export const defaultOptions = {
babel: {},
postcss: [],
templates: [],
watch: []
watch: [],
devMiddleware: {},
hotMiddleware: {}
},
generate: {
dir: 'dist',