How do I enable webpack middleware for Nuxt? During development, the build process is slow when writing files to disk, and I wish to use webpack middleware to generate build files in the memory.
Nuxt documentation states it is an Object
. I have tried adding this to my nuxt.config.js
, but it does not work.
webpackMiddleware: webpackMiddleware(webpack({
entry: '...',
output: {
path: '/'
}
}), {
noInfo: false,
quiet: false,
lazy: false,
watchOptions: {
aggregateTimeout: 300,
poll: true
},
publicPath: ['/assets/', '/static/'],
index: 'index.html',
headers: { 'X-Custom-Header': 'yes' },
stats: {
colors: true
},
reporter: null,
serverSideRender: false
})
I would appreciate a working example.
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1803">#c1803</a>)</em></sub></div>