Skip to content

Commit 770b3ec

Browse files
committed
Allow externalizing builtins (via include) when builtins=false
1 parent bca602e commit 770b3ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

source/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ function nodeExternals(options: ExternalsOptions = {}): Plugin {
226226
},
227227

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

@@ -239,7 +239,7 @@ function nodeExternals(options: ExternalsOptions = {}): Plugin {
239239
: config.builtinsPrefix === 'add' || builtins.alwaysPrefixed.has(id)
240240
? nodePrefix + stripped
241241
: stripped,
242-
external: config.builtins && !isExcluded(id),
242+
external: (config.builtins || isIncluded(id)) && !isExcluded(id),
243243
moduleSideEffects: false
244244
}
245245
}

0 commit comments

Comments
 (0)