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, slsDir: null,
targets: [], targets: [],
templates: [], templates: [],
static: [
'/about'
],
nuxt: 2, nuxt: 2,
target: null, target: null,
minify: null, minify: null,

View File

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