Skip to content

Added Webpack federation support#103

Merged
hzsrc merged 3 commits intohzsrc:masterfrom
litong-n99:master
May 3, 2022
Merged

Added Webpack federation support#103
hzsrc merged 3 commits intohzsrc:masterfrom
litong-n99:master

Conversation

@litong-n99
Copy link

Hi there, your plugin awesome. But when I was developing a Monorepo project that both main and sub project need change theme, it will only change the sub project theme. I think the problem is you set '__theme_COLOR_cfg' to Window and sub project overrode it, so main project read incorrect value.
I had added a random number to fix it, and you could have a test by https://github.com/litong-n99/vue2-admin

@litong-n99
Copy link
Author

It's already been a week and I haven't gotten a response. This is now becoming urgent for my project.

Could u merge it if it's available or give me a feedback~ @hzsrc

@hzsrc
Copy link
Owner

hzsrc commented Apr 30, 2022

Normally, you just need to add this plugin into the top project, and do not add to any sub projects. Because if you do this, css will be scaned twice and download twice, it's not recommended.
Another reason is, these change may make the plugin code more complicated.
So, I'm afraid that I can't merge this yet.

@litong-n99
Copy link
Author

I know what you are concerning, and I am sorry about my inaccurate description.

Actually it is a project with Webpack's federation, and when main project change theme, the sub project couldn't get the right Theme path.

As you said, I can just add this plugin into the top Monorepo project, but this only applies to the use of NPM‘s association, not Webpack's federation association.

image

@litong-n99 litong-n99 changed the title Added Monorepo support Added Webpack federation support May 1, 2022
@hzsrc hzsrc merged commit 0d9aeef into hzsrc:master May 3, 2022
@hzsrc
Copy link
Owner

hzsrc commented May 3, 2022

Done this. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants