idonava / base-mf-app

This project is built on React, Module Federation, and Rspack. It is designed to reproduce our shared dependencies issue. To accomplish this, we have created a new external package called external-package-version-display, which is used in all of the project MFEs.
0 stars 1 forks source link

MF adds unrequested caret (^) to shareConfig package requiredVersion #3

Closed idonava closed 1 month ago

idonava commented 1 month ago
  1. In mfe-remote-1-child-1 package.json we set external-package-version-display to 1.1.0 (without ^): https://github.com/idonava/base-mf-app/blob/63cfc5e42dc33f779fc262f6094e077d3f4cc5ad/apps/mfe-remote-1/remotes/mfe-remote-1-child-1/package.json#L15
  2. In mfe-remote-1-child-1 rsbuild.config.ts we set the requiredVersion of external-package-version-display to the version in the package.json (1.1.0, without ^) in the shared scope. https://github.com/idonava/base-mf-app/blob/main/apps/mfe-remote-1/remotes/mfe-remote-1-child-1/rsbuild.config.ts#L38-L40

In the FEDERATION object, the external-package-version-display requiredVersion in mfe-remote-1-child-1 MFE is "^1.1.0" instead of "1.1.0" (added unnecessary ^) image

2heal1 commented 1 month ago

It will be fixed in this pr https://github.com/web-infra-dev/rspack/pull/7408

idonava commented 1 month ago

Thanks!