mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 13:45:18 +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,
|
slsDir: null,
|
||||||
targets: [],
|
targets: [],
|
||||||
templates: [],
|
templates: [],
|
||||||
|
static: [
|
||||||
|
'/about'
|
||||||
|
],
|
||||||
nuxt: 2,
|
nuxt: 2,
|
||||||
target: null,
|
target: null,
|
||||||
minify: null,
|
minify: null,
|
||||||
|
@ -21,6 +21,13 @@ export default function () {
|
|||||||
ignore.push(baseConfig.slsDir)
|
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))
|
nuxt.hook('generate:done', () => buildSLS(baseConfig))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user