Describe the bug
The @module-federation/enhanced documentation states that runtimePlugins supports package names.
However, with @module-federation/enhanced@2.8.1, using a package name as a runtimePlugins entry fails during the build. The package name is converted into a filesystem path relative to process.cwd() instead of being resolved using Node.js module resolution.
Configuration that fails:
runtimePlugins: [
'@module-federation/inject-external-runtime-core-plugin',
],
Actual result:
Module not found: Error: Can't resolve
'<project-root>/@module-federation/inject-external-runtime-core-plugin'
The build succeeds when the package is passed through require.resolve():
runtimePlugins: [
require.resolve('@module-federation/inject-external-runtime-core-plugin'),
],
A package name supplied to runtimePlugins should be resolved using Node.js package resolution and behave the same as the absolute path returned by require.resolve().
Reproduction
https://github.com/dmchoi77/enhanced-runtime-plugins-repro
Used Package Manager
pnpm
System Info
OS: macOS
Node.js: v22.22.0
pnpm: 10.28.0
Package: @module-federation/runtime-core@2.8.1
Validations
Describe the bug
The
@module-federation/enhanceddocumentation states thatruntimePluginssupports package names.However, with
@module-federation/enhanced@2.8.1, using a package name as aruntimePluginsentry fails during the build. The package name is converted into a filesystem path relative toprocess.cwd()instead of being resolved using Node.js module resolution.Configuration that fails:
Actual result:
The build succeeds when the package is passed through
require.resolve():A package name supplied to
runtimePluginsshould be resolved using Node.js package resolution and behave the same as the absolute path returned byrequire.resolve().Reproduction
https://github.com/dmchoi77/enhanced-runtime-plugins-repro
Used Package Manager
pnpm
System Info
Validations