diff --git a/src/webpack.config.js b/src/webpack.config.js index c08f42f7..1b208675 100644 --- a/src/webpack.config.js +++ b/src/webpack.config.js @@ -53,7 +53,9 @@ const ENABLE_CACHING = isLocal ? config.options.caching : false; // Handle the "all" option in externals // And add the forceExclude packages to it because they shouldn't be Webpacked const computedExternals = ( - externals === "all" ? [nodeExternals()] : externals + externals === "all" + ? [nodeExternals({ additionalModuleDirs: [path.resolve(process.cwd(), "../../node_modules")] })] + : externals ).concat(forceExclude); const extensions = [ diff --git a/tests/externals-all/externals-all.test.js b/tests/externals-all/externals-all.test.js index 9d9c2d54..d1129e1e 100644 --- a/tests/externals-all/externals-all.test.js +++ b/tests/externals-all/externals-all.test.js @@ -16,5 +16,5 @@ test("externals all option", async () => { /* Ensure that array-first is packaged as a part of the "all" externals option */ - expect(result).toMatch(/Packing external modules: array-first@\^[\d\\.]+/); + expect(result).toMatch(/Packing external modules: source-map-support, array-first@\^[\d\\.]+/); });