feature: add static.prefix

This commit is contained in:
Clark Du 2018-02-04 00:54:42 +08:00
parent b0eada0410
commit a81af22d41
No known key found for this signature in database
GPG Key ID: D0E5986AF78B86D9

View File

@ -249,12 +249,12 @@ module.exports = class Renderer {
}
// For serving static/ files to /
this.useMiddleware(
serveStatic(
const staticMiddleware = serveStatic(
resolve(this.options.srcDir, 'static'),
this.options.render.static
)
)
staticMiddleware.prefix = this.options.render.static.prefix
this.useMiddleware(staticMiddleware)
// Serve .nuxt/dist/ files only for production
// For dev they will be served with devMiddleware