From 873c89e52c5cf0696aff893c43408229a6a0c2ff Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Wed, 27 Mar 2024 16:11:25 +0100 Subject: [PATCH] fix(externals): skip resolving virtual ids start with `\0` (#2321) --- src/rollup/plugins/externals.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/rollup/plugins/externals.ts b/src/rollup/plugins/externals.ts index fb1fe869fc..f2e58165e4 100644 --- a/src/rollup/plugins/externals.ts +++ b/src/rollup/plugins/externals.ts @@ -41,6 +41,9 @@ export function externals(opts: NodeExternalsOptions): Plugin { const _resolveCache = new Map(); const _resolve = async (id: string): Promise => { + if (id.startsWith("\0")) { + return id; + } let resolved = _resolveCache.get(id); if (resolved) { return resolved; @@ -63,6 +66,9 @@ export function externals(opts: NodeExternalsOptions): Plugin { // Utility to check explicit inlines const isExplicitInline = (id: string, importer: string) => { + if (id.startsWith("\0")) { + return true; + } const inlineMatch = inlineMatchers.find((m) => m(id, importer)); const externalMatch = externalMatchers.find((m) => m(id, importer)); if (