We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f9480ec commit c9f5a6eCopy full SHA for c9f5a6e
lib/app.js
@@ -77,9 +77,16 @@ module.exports = (app, options) => {
77
app.use(compression({ threshold: 0 }))
78
app.use(favicon(config.favicon))
79
if (config.api.hasPlugin('pwa')) {
80
- app.get('/service-worker.js', serve(config.serviceWorkerPath))
+ app.use('/service-worker.js', serve(config.serviceWorkerPath, true))
81
}
82
- app.use(/^((?!index\.).)*$/i, serve(config.distPath, true))
+ const serveStaticFiles = serve(config.distPath, true)
83
+ app.use((req, res, next) => {
84
+ if (/index\.html/g.test(req.path)) {
85
+ next()
86
+ } else {
87
+ serveStaticFiles(req, res, next)
88
+ }
89
+ })
90
91
// Render the Vue app using the bundle renderer
92
const renderApp = (req, res) => {
0 commit comments