Skip to content

Commit 7eafe1e

Browse files
committedJan 29, 2019
fix: properly handle bundleNodeModules when it's an array
1 parent 26c19ae commit 7eafe1e

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed
 

‎bili.config.ts

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ const config: Config = {
88
},
99
bundleNodeModules: true,
1010
externals: [
11-
...Object.keys(require('./package').dependencies),
1211
'spawn-sync' // from cross-spawn which is from execa which is from term-size which is from boxen
1312
],
1413
babel: {

‎src/plugins/node-resolve.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ export default (options: Options) => {
5151
if (!options.bundleNodeModules) {
5252
return false
5353
}
54-
const bundleNodeModules =
55-
Array.isArray(options.bundleNodeModules) &&
56-
options.bundleNodeModules.some(name =>
54+
if (Array.isArray(options.bundleNodeModules)) {
55+
const shouldBundle = options.bundleNodeModules.some(name =>
5756
id.includes(`/node_modules/${name}/`)
5857
)
59-
if (!bundleNodeModules) {
60-
return false
58+
if (!shouldBundle) {
59+
return false
60+
}
6161
}
6262
}
6363

0 commit comments

Comments
 (0)
Please sign in to comment.