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
refactor: unocss plugin with vite plugin and webpack plugin #9324
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov ReportBase: 29.38% // Head: 29.37% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #9324 +/- ##
==========================================
- Coverage 29.38% 29.37% -0.01%
==========================================
Files 413 413
Lines 11479 11482 +3
Branches 2740 2742 +2
==========================================
Hits 3373 3373
- Misses 7596 7598 +2
- Partials 510 511 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
为什么关闭了?@apply 还是挺常用的 |
unocss/webpack插件的缓存有问题,二次编译没有生成uno.css,umi也没有提供关闭缓存的配置 |
而且unocss/cli我已经提了pr支持了transform的能力了,只不过会改变源码 unocss/unocss#1592 webpack插件的坑一时半会填不完 |
示例 更新了cli版本,directives transformer 也不生效,跟umi有关系吗? |
可以加一下这个配置试试,可能是directives transformer默认排除了样式文件 include: [/src.*\.([jt]sx|less)$/],
exclude: [], |
问题
原来的unocss-plugin基于@unocss/cli,在编译前拿到uno.css,但是unocss新的一些transformer能力cli无法支持,比如Variant Groups, CSS Directives
方案
用unocss提供的vite plugin和webpack plugin对unocss plugin进行重构支持这些能力
View rendered docs/docs/guides/styling.md