Skip to content

Commit 381ffb5

Browse files
committed
Fix nan issue
1 parent a655677 commit 381ffb5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

webpack.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@ function getEntry() {
1919
fs.copySync(p, 'out/node_modules/' + mod);
2020
}
2121

22+
// The nan module is nested inside usb-detection, so it was already copied.
23+
const noEntryModules = unbundledModule.concat(['nan']);
2224
const list = getDependenciesFromNpm(mod);
2325
const moduleList = list.filter((value, index, self) => {
2426
// Some entries in the list of unbundled modules are really namespaces, so
2527
// we do a prefix match to see if the module should be excluded. This isn't
2628
// perfect, but works for the set of modules we care about.
27-
return self.indexOf(value) === index && unbundledModule.filter(m => value.startsWith(m)).length === 0 && !/^@types\//.test(value);
29+
return self.indexOf(value) === index && noEntryModules.filter(m => value.startsWith(m)).length === 0 && !/^@types\//.test(value);
2830
});
2931

3032
for (const mod of moduleList) {

0 commit comments

Comments
 (0)