Skip to content

Commit

Permalink
fix: buildDependencies lost after build failure (#504)
Browse files Browse the repository at this point in the history
Co-authored-by: EGOIST <0x142857@gmail.com>
  • Loading branch information
skywalker512 and egoist committed Dec 25, 2021
1 parent 6c44f3d commit 40951ec
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/index.ts
Expand Up @@ -187,6 +187,9 @@ export async function build(_options: Options) {

const buildAll = async () => {
const killPromise = killPreviousProcess()
// Store previous build dependencies in case the build failed
// So we can restore it
const previousBuildDependencies = new Set(buildDependencies)
buildDependencies.clear()

if (options.clean) {
Expand Down Expand Up @@ -217,6 +220,9 @@ export async function build(_options: Options) {
css: index === 0 || options.injectStyle ? css : undefined,
logger,
buildDependencies,
}).catch((error) => {
previousBuildDependencies.forEach(v => buildDependencies.add(v))
throw error
})
}),
])
Expand Down

1 comment on commit 40951ec

@vercel
Copy link

@vercel vercel bot commented on 40951ec Dec 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.