diff --git a/lib/builder/builder.js b/lib/builder/builder.js index 776fefb37f..08352af0bd 100644 --- a/lib/builder/builder.js +++ b/lib/builder/builder.js @@ -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) { diff --git a/lib/core/options.js b/lib/core/options.js index 2a9f615d6e..3e21abf6c1 100755 --- a/lib/core/options.js +++ b/lib/core/options.js @@ -69,7 +69,9 @@ export const defaultOptions = { babel: {}, postcss: [], templates: [], - watch: [] + watch: [], + devMiddleware: {}, + hotMiddleware: {} }, generate: { dir: 'dist',