Skip to content

Commit

Permalink
fix(externals): check for explicit externals
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Apr 7, 2022
1 parent 7700500 commit b4ced48
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/rollup/plugins/externals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ export function externals (opts: NodeExternalsOptions): Plugin {
return null
}

// Check for explicit externals
if (opts.external.find(i => (id.startsWith(i) || idWithoutNodeModules.startsWith(i)))) {
return { id, external: true }
}

// Resolve id (rollup > esm)
const resolved = await this.resolve(originalId, importer, { ...options, skipSelf: true }) || { id }
if (!existsSync(resolved.id)) {
Expand Down

0 comments on commit b4ced48

Please sign in to comment.