I am using modern.js's source build (rspack source build plugin I guess) with module federation. In the reproduction repo, there are three apps/packages
app -> lazy-dep
lazy-dep -> singleton-dep
In package app, singleton-dep is specified as a singleton in the module federation configuration.
Now, if singleton-dep's dist/ folder does not exist, it is expected to use its source code for module federation. However, it does not work. The dist/ folder seems to be required.
I'd like to know if it is not supported, or I misconfigured something, or it is a bug.
To reproduce:
pnpm i
cd apps/app
pnpm dev
# open another shell
rm -r packages/singleton-dep/dist
From app's log, it shows it is expecting packages/singleton-dep/dist/es/index.js
After dist/ is removed, app could not compile and says × resolving fallback for shared module singleton-dep, the app could not run either.
Describe the bug
I am using modern.js's source build (rspack source build plugin I guess) with module federation. In the reproduction repo, there are three apps/packages
Now, if singleton-dep's
dist/
folder does not exist, it is expected to use its source code for module federation. However, it does not work. Thedist/
folder seems to be required.I'd like to know if it is not supported, or I misconfigured something, or it is a bug.
To reproduce:
From app's log, it shows it is expecting
packages/singleton-dep/dist/es/index.js
Afterdist/
is removed, app could not compile and says× resolving fallback for shared module singleton-dep
, the app could not run either.Reproduction
https://github.com/yf-yang/module-federation-sourcebuild-debug
Used Package Manager
pnpm
System Info
Validations