mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-30 23:32:38 +00:00
Merge pull request #2755 from clarkdo/static_prefix
feature: add static.prefix
This commit is contained in:
commit
0a52cd2031
@ -305,7 +305,9 @@ Options.defaults = {
|
|||||||
push: false,
|
push: false,
|
||||||
shouldPush: null
|
shouldPush: null
|
||||||
},
|
},
|
||||||
static: {},
|
static: {
|
||||||
|
prefix: true
|
||||||
|
},
|
||||||
gzip: {
|
gzip: {
|
||||||
threshold: 0
|
threshold: 0
|
||||||
},
|
},
|
||||||
|
@ -249,12 +249,12 @@ module.exports = class Renderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// For serving static/ files to /
|
// For serving static/ files to /
|
||||||
this.useMiddleware(
|
const staticMiddleware = serveStatic(
|
||||||
serveStatic(
|
resolve(this.options.srcDir, 'static'),
|
||||||
resolve(this.options.srcDir, 'static'),
|
this.options.render.static
|
||||||
this.options.render.static
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
staticMiddleware.prefix = this.options.render.static.prefix
|
||||||
|
this.useMiddleware(staticMiddleware)
|
||||||
|
|
||||||
// Serve .nuxt/dist/ files only for production
|
// Serve .nuxt/dist/ files only for production
|
||||||
// For dev they will be served with devMiddleware
|
// For dev they will be served with devMiddleware
|
||||||
|
Loading…
Reference in New Issue
Block a user