diff --git a/packages/subapp-web/lib/util.js b/packages/subapp-web/lib/util.js index 85cd5986c..4a09b8c4d 100644 --- a/packages/subapp-web/lib/util.js +++ b/packages/subapp-web/lib/util.js @@ -71,7 +71,12 @@ const utils = { // .~.bundle[.dev].js // See xarc-webpack/lib/partial/subapp-chunks.js // - const matchEntry = x => x.startsWith(`${entryName}.bundle`) || x.startsWith(`${entryName}.~`); + const matchEntry = x => + x && + (x.startsWith(`${entryName}.bundle`) || + // if a subapp comes from a package in node_modules, webpack5 names entry like this + x.startsWith(`${entryName}~_.bundle`) || + x.startsWith(`${entryName}.~`)); // map all IDs to actual assets const bundleAssets = entryPoints .map(id => {