Skip to content

Commit

Permalink
fix: suppress addWatchFile invalid phase error (#14751)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy committed Oct 26, 2023
1 parent 4150bcb commit c3622d7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/vite/src/node/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,15 @@ export function onRollupWarning(
return
}

// Rollup tracks the build phase slightly earlier before `buildEnd` is called,
// so there's a chance we can call `this.addWatchFile` in the invalid phase. Skip for now.
if (
warning.plugin === 'vite:worker-import-meta-url' &&
warning.pluginCode === 'INVALID_ROLLUP_PHASE'
) {
return
}

if (warningIgnoreList.includes(warning.code!)) {
return
}
Expand Down

0 comments on commit c3622d7

Please sign in to comment.