Skip to content
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

fix(webpack): webpack4 optimize filter * #1428

Merged
merged 2 commits into from Aug 18, 2022

Conversation

PatrickChen928
Copy link
Contributor

@PatrickChen928 PatrickChen928 commented Aug 17, 2022

fixes: #1401 #1417

It is because mini-css-extract-plugin create a childCompiler that trigger the unocss's optimizeAssets before the main compiler, then unocss change the content. So, when the main trigger optimizeAssets, this haven't LAYER_PLACEHOLDER_RE anymore, and there is no way to update the latest tokens content to final asserts.

And mini-css-extract-plugin's file name is *, so it works by filter * file. Or is there more better solution?

@netlify
Copy link

netlify bot commented Aug 17, 2022

Deploy Preview for unocss ready!

Name Link
🔨 Latest commit 8ae5955
🔍 Latest deploy log https://app.netlify.com/sites/unocss/deploys/62fde1ec68d505000902bccc
😎 Deploy Preview https://deploy-preview-1428--unocss.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@zyyv zyyv linked an issue Aug 17, 2022 that may be closed by this pull request
@PatrickChen928
Copy link
Contributor Author

This actually could solve this two issues.
But I found that, it will be infinite compile when I run pnpm run dev in project example/vue-cli, simile #856.Then I create new project with the latest vue-cli, test the different unocss's version. It get the same result.
Although it does not seem to be caused by this change, I need to look again.Or create a new issue about that.

@zouhangwithsweet
Copy link
Contributor

does it work with vue-router ?

@PatrickChen928
Copy link
Contributor Author

yes. I cloned your minimal reproduction, and it works by my test.

@PatrickChen928 PatrickChen928 marked this pull request as ready for review August 17, 2022 15:12
@antfu antfu merged commit 5b9e93a into unocss:main Aug 18, 2022
@PatrickChen928 PatrickChen928 deleted the fix/webpack4-build branch August 18, 2022 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants