Skip to content

Commit 7e44547

Browse files
committed
fix: all-monorepo implementation
1 parent a2e386b commit 7e44547

1 file changed

Lines changed: 7 additions & 14 deletions

File tree

src/webpack.config.js

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,14 @@ const GENERATE_STATS_FILES = config.options.generateStatsFiles;
5151
const ENABLE_CACHING = isLocal ? config.options.caching : false;
5252

5353
// Handle "all" and "all-monorepo" option in externals
54-
function computedExternals() {
55-
switch(externals) {
56-
case "all":
57-
return [nodeExternals()];
58-
59-
case "all-monorepo":
60-
return [nodeExternals({ additionalModuleDirs: [path.resolve(process.cwd(), "../../node_modules")] })];
61-
62-
default:
63-
return externals;
64-
}
65-
}
66-
6754
// And add the forceExclude packages to it because they shouldn't be Webpacked
68-
const computedExternals = computedExternals().concat(forceExclude);
55+
const computedExternals = (
56+
externals === "all"
57+
? [nodeExternals()]
58+
: externals === "all-monorepo"
59+
? [nodeExternals({ additionalModuleDirs: [path.resolve(process.cwd(), "../../node_modules")] })]
60+
: externals
61+
).concat(forceExclude);
6962

7063
const extensions = [
7164
".wasm",

0 commit comments

Comments
 (0)