Skip to content

Commit 60db906

Browse files
committed
Add named export nodeExternals
1 parent 8866dcf commit 60db906

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

source/index.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ const isString = (str: unknown): str is string =>
126126
* A Rollup plugin that automatically declares NodeJS built-in modules,
127127
* and optionally npm dependencies, as 'external'.
128128
*/
129-
function externals(options: ExternalsOptions = {}): Plugin {
129+
function nodeExternals(options: ExternalsOptions = {}): Plugin {
130130

131131
const config: Config = { ...defaults, ...options }
132132
let include: RegExp[],
@@ -252,5 +252,8 @@ function externals(options: ExternalsOptions = {}): Plugin {
252252
}
253253
}
254254

255-
export default externals
256-
export { externals }
255+
export default nodeExternals
256+
export {
257+
nodeExternals, // Named export since 6.1
258+
nodeExternals as externals // For backwards compatibility
259+
}

0 commit comments

Comments
 (0)