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,
|
||||
shouldPush: null
|
||||
},
|
||||
static: {},
|
||||
static: {
|
||||
prefix: true
|
||||
},
|
||||
gzip: {
|
||||
threshold: 0
|
||||
},
|
||||
|
@ -249,12 +249,12 @@ module.exports = class Renderer {
|
||||
}
|
||||
|
||||
// For serving static/ files to /
|
||||
this.useMiddleware(
|
||||
serveStatic(
|
||||
resolve(this.options.srcDir, 'static'),
|
||||
this.options.render.static
|
||||
)
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user