From 60db906be7031c0050940d729bd01881ac21039b Mon Sep 17 00:00:00 2001 From: Stephan Schreiber Date: Fri, 2 Jun 2023 23:35:22 +0200 Subject: [PATCH] Add named export nodeExternals --- source/index.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/index.ts b/source/index.ts index 9c61876..25bc565 100644 --- a/source/index.ts +++ b/source/index.ts @@ -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[], @@ -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 +}