Skip to content

Commit

Permalink
Allow externalizing builtins (via include) when builtins=false
Browse files Browse the repository at this point in the history
  • Loading branch information
Septh committed Jun 2, 2023
1 parent bca602e commit 770b3ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ function nodeExternals(options: ExternalsOptions = {}): Plugin {
},

async resolveId(id) {
// Let Rollup handle already resolved ids, relative imports and virtual modules.
// Ignore already resolved ids, relative imports and virtual modules.
if (path.isAbsolute(id) || /^(?:\0|\.{1,2}[\\/])/.test(id))
return null

Expand All @@ -239,7 +239,7 @@ function nodeExternals(options: ExternalsOptions = {}): Plugin {
: config.builtinsPrefix === 'add' || builtins.alwaysPrefixed.has(id)
? nodePrefix + stripped
: stripped,
external: config.builtins && !isExcluded(id),
external: (config.builtins || isIncluded(id)) && !isExcluded(id),
moduleSideEffects: false
}
}
Expand Down

0 comments on commit 770b3ec

Please sign in to comment.