originjs / vite-plugin-federation

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

fix: removeNonRegLetter for chunk filename #621

Closed imyangyong closed 2 months ago

imyangyong commented 3 months ago

Description

When I was working on the remote side and using the shared features with a scoped package, as in the following example

shared: {
  '@vue/composition-api': { generate: false }
}

I found that the generate: false setting had no effect. This is because the shareName2Prop map applies the removeNonRegLetter function to the package name @vueComposition-api as it's key. Therefore, when determining the needRemoveShared condition, we should also apply removeNonRegLetter to the chunk filename. This change is necessary for the program to work correctly.

Additional context


What is the purpose of this pull request?

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