vite-plugin-federation
vite-plugin-federation copied to clipboard
Executing the build command through mode cannot resolve the path of the federation
Versions
- originjs: v1.1.0
- node: v14.15.4
Reproduction
https://github.com/GOGOGOSIR/vite-build-issue.git
Steps to reproduce
In a project using federation, it works fine if you use the yarn build command to package, but if you use yarn build --mode test, federation cannot be resolved

After I checked, I found that the mode of the registerPlugins function is env.mode. If the user uses --mode test to execute the packaging command, it will result in an empty array in registerPlugins, so an error will be reported when packaging

It is recommended to change the mode attribute of the options of federation to a mandatory item, which is controlled by the user
Thanks, looks like a good suggestion, add to the plan first