-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignores dynamic import css chunks generated via mini-css-extract-plugin #40
Comments
@bitfella can you elaborate a little on what's going on? Are you seeing any errors? If not, what behavior are you expecting that is not happening? I'm not seeing any build errors on Mac (waiting for a Windows VM to download currently). If this is a Windows-only issue, it's possible that you're also running into the root cause of #39 (see the ongoing discussion there) - and if that's the case, try updating to |
@DanielSchaffer hi, no console errors whatsoever. Simply It does not spit out dynamic import css chunks. If I remove webpack-babel-multi-target-plugin in my example repo, everything works as expected (dynamic import css chunks are correctly generated). I will try next.3 as soon as I get back to the office (I got no Windows PC at home). Thanks! |
@DanielSchaffer updated to
|
@DanielSchaffer I've updated my test repo with a new branch Thanks again |
Hi @DanielSchaffer, any update on this? Thanks |
@bitfella hey there - sorry, I haven't been able to look at this specifically yet. Hopefully I'll be able to take a peek this weekend. If you have the time and inclination to take a look yourself before then, |
For some background, I'm poking around a bit now with the debugger, and seeing a couple things:
I'm a bit unclear on what my intention was with the |
…ed in build output - add implementation for BabelTarget.getTargetFromGroup() - add method to determine the original asset name from a targeted asset name fixes #40
@bitfella - I've got something working for the updated |
Hi @DanielSchaffer, thanks for your work!
as a consequence, in the ES6 bundle dynamic import css chunks are not loaded in the browser even if they're in the filesystem. In the ES5 bundle, otherwise, these chunks are correctly loaded. I've updated my test repo (both branches): in Hope you can help, thanks again! |
Ohh interesting. I think I understand why this is happening - the CSS module gets removed from the ES6 bundles to prevent creating a duplicate, but that also removes the JS code that causes it to be loaded. For non-dynamic CSS modules it's not a problem since they're automatically linked by I'll have to see if there's a way I can just replace the duplicate CSS module with the non-duplicate instead of removing it completely. |
@bitfella okay, got another update for you. My assumption was correct - the extracted CSS modules also have sibling JS modules that include the code required to load the CSS assets when the dynamic module is loaded. Since the CSS modules were getting removed and getting added to the "standin" chunk, there is nothing left to link the loading code and the actual CSS, so while the dynamic module's CSS gets generated into an asset, nothing happens to load it. I'm working around the issue for now by disabling the "css normalizing" functionality for dynamic modules, so starting with Let me know if this works for you, and I'll cut the final |
Hi, @DanielSchaffer thanks for the update! Just tested Thanks again! |
@bitfella hi, I have the same problem, the css in dynamic import not output, did you solve it? |
Hi @xn330125, yes I "solved" it since I changed job, so I am not using that stuff anymore :) |
Hello,
seems like this plugin can't output dynamic import css chunks generated via mini-css-extract-plugin.
I am using version 2.3.1-next.1 (Windows 10) to overcome #38 #39
Please see this repo for further details: https://github.com/bitfella/webpack-babel-multi-target-plugin-test
Thanks!
The text was updated successfully, but these errors were encountered: