mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 23:52:06 +00:00
fix(cli): handle generate.cache.ignore
as a function in ensureBuild
(#8337)
This commit is contained in:
parent
92a06615d0
commit
80571bc05d
@ -43,7 +43,7 @@ export async function ensureBuild (cmd) {
|
|||||||
|
|
||||||
// Extend ignore
|
// Extend ignore
|
||||||
const { generate } = options
|
const { generate } = options
|
||||||
if (generate.cache.ignore === 'function') {
|
if (typeof generate.cache.ignore === 'function') {
|
||||||
generate.cache.ignore = generate.cache.ignore(ignore)
|
generate.cache.ignore = generate.cache.ignore(ignore)
|
||||||
} else if (Array.isArray(generate.cache.ignore)) {
|
} else if (Array.isArray(generate.cache.ignore)) {
|
||||||
generate.cache.ignore = generate.cache.ignore.concat(ignore)
|
generate.cache.ignore = generate.cache.ignore.concat(ignore)
|
||||||
@ -52,9 +52,9 @@ export async function ensureBuild (cmd) {
|
|||||||
|
|
||||||
// Take a snapshot of current project
|
// Take a snapshot of current project
|
||||||
const snapshotOptions = {
|
const snapshotOptions = {
|
||||||
rootDir: nuxt.options.rootDir,
|
rootDir: options.rootDir,
|
||||||
ignore: nuxt.options.generate.cache.ignore.map(upath.normalize),
|
ignore: generate.cache.ignore.map(upath.normalize),
|
||||||
globbyOptions: nuxt.options.generate.cache.globbyOptions
|
globbyOptions: generate.cache.globbyOptions
|
||||||
}
|
}
|
||||||
|
|
||||||
const currentBuildSnapshot = await snapshot(snapshotOptions)
|
const currentBuildSnapshot = await snapshot(snapshotOptions)
|
||||||
|
Loading…
Reference in New Issue
Block a user