-
-
Notifications
You must be signed in to change notification settings - Fork 189
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
Using @wxt-dev/module-vue together with UnoCSS #1026
Comments
Here's the starter template with vue and unocss Your import { defineConfig } from "wxt";
import UnoCSS from "unocss/vite";
// See https://wxt.dev/api/config.html
export default defineConfig({
modules: ["@wxt-dev/module-vue"],
hooks: {
"vite:build:extendConfig": (entries, config) => {
if (entries.find(e => e.inputPath.endsWith(".html")))
config.plugins!.push(UnoCSS());
},
"vite:devServer:extendConfig": config => {
config.plugins!.push(UnoCSS());
}
}
}); And then very important is that you import the style in your entrypoint import "virtual:uno.css";
import { createApp } from "vue";
import App from "./App.vue";
createApp(App).mount("#app"); Greetings from Germany 😅 |
@aklinker1 Should I make a wxt module for |
It should be a separate module. |
@Timeraa Thanks for your help! However, I'm now running into this issue:
|
This line is only adding the unocss vite plugin to HTML builds. if (entries.find(e => e.inputPath.endsWith(".html")))
config.plugins!.push(UnoCSS()); If you're using it in content scripts, you need to update the |
@aklinker1 oh thanks! |
@aklinker1 it seems I'm still something missing to get it working in the content script. The css file is created correctly and the content seems to be there However, the ui of the content script is not styled. I'm also seeing this log
Eventhough I have the
in place in my content/index.ts, as well as my App.vue Is there anything else I need to do in order to get this working? |
Feature Request / Example Provision
Hello,
first of all thank you for the wxt plugin, it makes things really easy so far.
However, I'm usually using Vue together with UnoCSS and I'm failing to do so with WXT, especially using @wxt-dev/module-vue.
Is this in general possible and could you provide an example if this is already working?
I'm currently running into diverse issues like this
or this, depending on my config
And this is my config, which is probably totally wrong.
Thank you In advance
The text was updated successfully, but these errors were encountered: