Skip to content

Commit

Permalink
fix(externals): skip resolving virtual ids start with \0 (#2321)
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Mar 27, 2024
1 parent 825d94f commit 873c89e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/rollup/plugins/externals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ export function externals(opts: NodeExternalsOptions): Plugin {

const _resolveCache = new Map();
const _resolve = async (id: string): Promise<string> => {
if (id.startsWith("\0")) {
return id;
}
let resolved = _resolveCache.get(id);
if (resolved) {
return resolved;
Expand All @@ -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 (
Expand Down

0 comments on commit 873c89e

Please sign in to comment.