mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
feat: whitelist static routes
This commit is contained in:
parent
486c881b2d
commit
e0505568aa
@ -10,6 +10,9 @@ export function getBaseConfig (options) {
|
||||
slsDir: null,
|
||||
targets: [],
|
||||
templates: [],
|
||||
static: [
|
||||
'/about'
|
||||
],
|
||||
nuxt: 2,
|
||||
target: null,
|
||||
minify: null,
|
||||
|
@ -21,6 +21,13 @@ export default function () {
|
||||
ignore.push(baseConfig.slsDir)
|
||||
})
|
||||
|
||||
nuxt.hook('generate:page', (page) => {
|
||||
// TODO: Use ssrContext
|
||||
if (!baseConfig.static.includes(page.route)) {
|
||||
page.exclude = true
|
||||
}
|
||||
})
|
||||
|
||||
nuxt.hook('generate:done', () => buildSLS(baseConfig))
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user