Skip to content

Commit a787f4f

Browse files
committed
fix(esbuild): clear stale metadata entries during build state reset
1 parent eedca87 commit a787f4f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

packages/esbuild-plugin/src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ function esbuildDebugIdInjectionPlugin(logger: Logger): UnpluginOptions {
6565
setup({ initialOptions, onLoad, onResolve }) {
6666
// Clear state from previous builds (important for watch mode and test suites)
6767
debugIdWrappedPaths.clear();
68+
// Also clear metadataProxyEntryPoints here because if moduleMetadataInjectionPlugin
69+
// is not instantiated in this build (e.g., moduleMetadata was disabled), we don't
70+
// want stale entries from a previous build to affect the current one.
71+
metadataProxyEntryPoints.clear();
6872

6973
if (!initialOptions.bundle) {
7074
logger.warn(

0 commit comments

Comments
 (0)