Skip to content

Commit

Permalink
Add named export nodeExternals
Browse files Browse the repository at this point in the history
  • Loading branch information
Septh committed Jun 2, 2023
1 parent 8866dcf commit 60db906
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions source/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const isString = (str: unknown): str is string =>
* A Rollup plugin that automatically declares NodeJS built-in modules,
* and optionally npm dependencies, as 'external'.
*/
function externals(options: ExternalsOptions = {}): Plugin {
function nodeExternals(options: ExternalsOptions = {}): Plugin {

const config: Config = { ...defaults, ...options }
let include: RegExp[],
Expand Down Expand Up @@ -252,5 +252,8 @@ function externals(options: ExternalsOptions = {}): Plugin {
}
}

export default externals
export { externals }
export default nodeExternals
export {
nodeExternals, // Named export since 6.1
nodeExternals as externals // For backwards compatibility
}

0 comments on commit 60db906

Please sign in to comment.