zodern / melte

Svelte compiler for Meteor with built in tracker integration and HMR
MIT License
33 stars 14 forks source link

Suggestion: config to force postcss preprocessing on all components #10

Closed arggh closed 3 years ago

arggh commented 3 years ago

I haven't really given this much thought yet, but I ran into a situation where I would like to have autoprefixer mangle the CSS of various Svelte components in our app, some of them residing in separate packages.

Now, to achieve that, it seems I'd need to somehow add lang="postcss" attribute to all those components' <style> tags.

Would be great, if I could configure zodern:melte to always run postcss plugins as preprocessors, regardless of any lang-attributes.

(I also tried to achieve autoprefixing using juliancwirko:postcss package, but that didn't have any effect on the Svelte components' CSS)

arggh commented 3 years ago

Maybe instead of config, the logic could work like so:

Use postcss as preprocessor if...

  1. this.postcss exists...
  2. ...and there is no lang attribute in the <style> block...
  3. ...or, if there is, it has to be postcss
arggh commented 3 years ago

Closed in favour of https://github.com/zodern/melte-compiler/issues/5