aklinker1 / vite-plugin-web-extension

Vite plugin for developing Chrome/Web Extensions
https://vite-plugin-web-extension.aklinker1.io/
MIT License
574 stars 48 forks source link

Sass for content scripts does not get processed #19

Closed Bauke closed 2 years ago

Bauke commented 2 years ago

Hi, I'm trying to convert a Parcel-based WebExtension to Vite and I have a small question.

I have a content scripts section that looks like this:

"content_scripts": [
  {
    "matches": [
      "*://tildes.net/*"
    ],
    "run_at": "document_end",
    "css": [
      "scss/scripts.scss"
    ],
    "js": [
      "content-scripts.ts"
    ]
  }
],

And while the TS gets built as expected, the Sass is copied over as-is which wasn't what I expected. I figured out I can change the CSS definition to "generated:style.css" and then add import './scss/scripts.scss'; to my content-scripts.ts file so the Sass does get processed, but it's not exactly ideal.

So my question is, is this how I should be doing it or is there a better way?

aklinker1 commented 2 years ago

Hmm, nope that is correct. You shouldn't have to do the generated: to get it working. I'll get a fix out for this when I have time, hopefully the next few days

aklinker1 commented 2 years ago

Just published v1.1.3, feel free to re-open this issue it doesn't work for you!

Bauke commented 2 years ago

Seems to work great, thanks for the quick fix!