PlasmoHQ / plasmo

🧩 The Browser Extension Framework
https://www.plasmo.com
MIT License
10.09k stars 347 forks source link

[EXP] How to use unocss? #344

Open itmanyong opened 1 year ago

itmanyong commented 1 year ago

What is the example you wish to see?

This one is hard to show because it is automatically generated and the code written is the same as normal. Here's an example: The framework already supports tailwindcss. If I want to use unocss, how can I load it? I can't find the way to load other extensions

Is there any context that might help us understand?

unocss Just a plug-in, the code effect is of no reference, because just like writing a normal class name, want to know how to make it work

Code of Conduct

louisgv commented 1 year ago

Thanks for filing an issue - Can unocss be used as a postcss plugin?

itmanyong commented 1 year ago

感谢您提交问题 - unocss 可以用作 postcss 插件吗?

According to the information I have inquired, it seems that it cannot be used directly

shah commented 1 year ago

I'd also like to know if UnoCSS can be used in a Plasmo extension. Thanks!

MinakoKitani commented 6 months ago

Thanks for filing an issue - Can unocss be used as a postcss plugin?

Unocss has @unocss/postcss plugins, but it use cjs. I followed the example provided by unocss to integrate with postcss, but I keep getting an error that says "Could not resolve module 'node:fs/promises'". Is this because plasmo's build and bundling tool is not compatible?

This is unocss's doc about how to use postcss plugins: https://unocss.dev/integrations/postcss#postcss-plugin

MinakoKitani commented 6 months ago

Thanks for filing an issue - Can unocss be used as a postcss plugin?

Unocss has @unocss/postcss plugins, but it use cjs. I followed the example provided by unocss to integrate with postcss, but I keep getting an error that says "Could not resolve module 'node:fs/promises'". Is this because plasmo's build and bundling tool is not compatible?

This is unocss's doc about how to use postcss plugins: https://unocss.dev/integrations/postcss#postcss-plugin

@louisgv Hello,I found it is parcel's version reason. parcel has fix this error in v2.10.0, and plasmo latest version (0.84.2) use parcel with v2.9.3. When plasmo will update parcel's version? parcel fix node:path error in this mr: https://github.com/parcel-bundler/parcel/pull/9244

jiweiyuan commented 4 months ago

Same problem, could you please solve this problems