From 707fb9a48d2375dffee9583273423ae0ed9f6958 Mon Sep 17 00:00:00 2001 From: daniel-stoian-lgp Date: Mon, 2 Feb 2026 18:20:22 +0200 Subject: [PATCH] Fixed `EnactFrameworkRefPlugin` to detect imports that come from ignored packages and bundle them directly into the view instead of trying to externalize them. --- CHANGELOG.md | 4 ++++ plugins/dll/EnactFrameworkRefPlugin.js | 14 +++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0d6f28..bccfaad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# unreleased + +* Fixed `EnactFrameworkRefPlugin` to detect imports that come from ignored packages and bundle them directly into the view instead of trying to externalize them. + # 7.0.3 (January 13, 2026) * Updated dependencies. diff --git a/plugins/dll/EnactFrameworkRefPlugin.js b/plugins/dll/EnactFrameworkRefPlugin.js index a80de77..35c5c8d 100644 --- a/plugins/dll/EnactFrameworkRefPlugin.js +++ b/plugins/dll/EnactFrameworkRefPlugin.js @@ -41,6 +41,18 @@ class DelegatedEnactFactoryPlugin { return callback(null, new DelegatedModule(name, {id: polyID}, 'require', polyID, polyID)); } else if (local && request && context && request.startsWith('.')) { let resource = path.join(context, request); + + // Check if the resource path contains any ignored package path + // This prevents externalizing internal imports from ignored packages + if (ignReg) { + const pathSegments = resource.split(/[\\/]node_modules[\\/]/); + for (const segment of pathSegments) { + if (ignReg.test(segment)) { + return callback(); // Don't externalize - bundle it instead + } + } + } + if ( resource.startsWith(app.context) && !/[\\/]tests[\\/]/.test('./' + path.relative(app.context, resource)) && @@ -52,7 +64,7 @@ class DelegatedEnactFactoryPlugin { .replace(app.context, app.name) .replace(/\.js$/, '') .replace(/\\/g, '/') - .replace(app.name + '/node_modules/', '') + .replace(/.*[\\/]node_modules[\\/]/, '') .replace(/[\\/]$/, ''); return callback(null, new DelegatedModule(name, {id: localID}, 'require', localID, localID)); }