fix(cli): handle generate.cache.ignore as a function in ensureBuild (#8337)

This commit is contained in:
Audrius Jakumavicius 2020-11-12 15:03:06 +01:00 committed by GitHub
parent 92a06615d0
commit 80571bc05d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,7 +43,7 @@ export async function ensureBuild (cmd) {
// Extend ignore
const { generate } = options
if (generate.cache.ignore === 'function') {
if (typeof generate.cache.ignore === 'function') {
generate.cache.ignore = generate.cache.ignore(ignore)
} else if (Array.isArray(generate.cache.ignore)) {
generate.cache.ignore = generate.cache.ignore.concat(ignore)
@ -52,9 +52,9 @@ export async function ensureBuild (cmd) {
// Take a snapshot of current project
const snapshotOptions = {
rootDir: nuxt.options.rootDir,
ignore: nuxt.options.generate.cache.ignore.map(upath.normalize),
globbyOptions: nuxt.options.generate.cache.globbyOptions
rootDir: options.rootDir,
ignore: generate.cache.ignore.map(upath.normalize),
globbyOptions: generate.cache.globbyOptions
}
const currentBuildSnapshot = await snapshot(snapshotOptions)