vite-plugin-federation icon indicating copy to clipboard operation
vite-plugin-federation copied to clipboard

Executing the build command through mode cannot resolve the path of the federation

Open GOGOGOSIR opened this issue 3 years ago • 3 comments

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

image

GOGOGOSIR avatar Mar 03 '22 06:03 GOGOGOSIR

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

image

GOGOGOSIR avatar Mar 03 '22 06:03 GOGOGOSIR

It is recommended to change the mode attribute of the options of federation to a mandatory item, which is controlled by the user

GOGOGOSIR avatar Mar 03 '22 06:03 GOGOGOSIR

Thanks, looks like a good suggestion, add to the plan first

Jiannan-dev avatar Mar 04 '22 01:03 Jiannan-dev