From a81af22d417694b25049180c8f2730a3d3240281 Mon Sep 17 00:00:00 2001 From: Clark Du Date: Sun, 4 Feb 2018 00:54:42 +0800 Subject: [PATCH 1/2] feature: add static.prefix --- lib/core/renderer.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/core/renderer.js b/lib/core/renderer.js index 234b2de1d..d0169225b 100644 --- a/lib/core/renderer.js +++ b/lib/core/renderer.js @@ -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 From e60a8e74630a6aa3da6c9ff5f79dd2616f9aa2e7 Mon Sep 17 00:00:00 2001 From: Clark Du Date: Mon, 5 Feb 2018 09:36:45 +0800 Subject: [PATCH 2/2] refactor: add true as default value of static.prefix --- lib/common/options.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/common/options.js b/lib/common/options.js index 32e84423b..82a7f866e 100755 --- a/lib/common/options.js +++ b/lib/common/options.js @@ -299,7 +299,9 @@ Options.defaults = { push: false, shouldPush: null }, - static: {}, + static: { + prefix: true + }, gzip: { threshold: 0 },