Skip to content

Commit bca602e

Browse files
committed
Misc changes
1 parent 942d055 commit bca602e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

source/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,10 @@ const isString = (str: unknown): str is string =>
129129
function nodeExternals(options: ExternalsOptions = {}): Plugin {
130130

131131
const config: Config = { ...defaults, ...options }
132+
132133
let include: RegExp[],
133134
exclude: RegExp[]
135+
134136
const isIncluded = (id: string) => include.some(rx => rx.test(id)),
135137
isExcluded = (id: string) => exclude.some(rx => rx.test(id))
136138

@@ -157,11 +159,9 @@ function nodeExternals(options: ExternalsOptions = {}): Plugin {
157159
// Populate the packagePath option if not given by getting all package.json files
158160
// from cwd up to the root of the git repo, the root of the monorepo,
159161
// or the root of the volume, whichever comes first.
160-
const packagePaths: string[] = Array.isArray(config.packagePath)
161-
? config.packagePath.filter(isString)
162-
: isString(config.packagePath)
163-
? [ config.packagePath ]
164-
: []
162+
const packagePaths = ([] as string[])
163+
.concat(config['packagePath'])
164+
.filter(isString)
165165
if (packagePaths.length === 0) {
166166
for (
167167
let current = process.cwd(), previous: string | undefined;
@@ -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 && !isExcluded(id),
243243
moduleSideEffects: false
244244
}
245245
}

0 commit comments

Comments
 (0)