originjs / vite-plugin-federation

Module Federation for vite & rollup
Other
2.39k stars 241 forks source link

Fix error during build for development mode #588

Closed danielwwc closed 8 months ago

danielwwc commented 8 months ago

Description

This PR solve the issue of error during build. npx vite build --mode development.

The mode can be used for environment and not limited to the command build or serve. It can be mode=development but command is build. Switching the sequence should fix the issue.

However there will be another issue, if someone want to serve a production environment. npx vite serve --mode production. For long term solution i would suggest to remove the mode from the condition statement.

error during build:
TypeError: [originjs:federation] Cannot read properties of undefined (reading 'config')

fixes #527 React: Cannot read properties of undefined (reading 'config') in devSharedScopeCode

Additional context


What is the purpose of this pull request?

Before submitting the PR, please make sure you do the following

flyfishzy commented 8 months ago

LGTM! Thanks for your PR!