@module-federation/enhanced/webpack
: types could not be generated when using a shared webpack config
#2304
Labels
🐞 bug
Something isn't working
Describe the bug
We have a monorepo setup with a shared webpack configuration package. The setup look kinda like this:
In this setup, the
configs
package contains thewebpack-shared.config.js
, which setups everything including the@module-federation/enhanced/webpack
plugin. The app imports the config object and overwrites some values.When I start the app with the OLD plugin
const ModuleFederationPlugin = webpack.container.ModuleFederationPlugin;
, everything works. But with the new plugin, the variables created from theDefinePlugin
are not available as typescript types, hence I get an error in the console:TS Error 2304':' Cannot find name 'MODULE_NAME'
. This breaks the build, but if I setdts: false,
the error still gets logged but the build works.My guess: The new
@module-federation/enhanced/webpack
plugin doesn't read thetsconfig.json
from theapp
package, but from theconfigs
package. As there is none, it uses some defaults.Used Package Manager
pnpm
Validations
The text was updated successfully, but these errors were encountered: