feat: whitelist static routes

This commit is contained in:
Pooya Parsa 2020-11-05 13:02:57 +01:00
parent 486c881b2d
commit e0505568aa
2 changed files with 10 additions and 0 deletions

View File

@ -10,6 +10,9 @@ export function getBaseConfig (options) {
slsDir: null,
targets: [],
templates: [],
static: [
'/about'
],
nuxt: 2,
target: null,
minify: null,

View File

@ -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))
}