tablecheck / dartsass-sprockets

Integrate Dart Sass with Sprockets (Ruby on Rails asset pipeline)
MIT License
35 stars 5 forks source link

@import css files does not work once the assets get compiled #24

Open coorasse opened 6 months ago

coorasse commented 6 months ago

I have an application.scss file that imports various files, some are SCSS and some simple CSS. I like to keep CSS files because dartsass does not need to process them and the feedback loop while developing is much faster, so I like to keep some files as simple CSS. The problem is that the @import "components/my_component.css" instruction is not compiled. I'd expect it to simply inline the CSS file as it is, but the instruction is kept. This even works in development mode so it seems that everywork will just work fine until you release in production and "components/my_component.css" cannot be resolved anymore.

I think this is quite unexpected behavior. I'd have liked my CSS file to be inlined.

Thoughts?

sronsiek commented 5 months ago

I came across the same thing - in my case removing the .css extension from all @import statements fixed.it.

johnnyshields commented 3 months ago

@coorasse can you try removing .css from your @import statements? If that works, it will be the accepted workaround for this, and I'll close the issue.

kieraneglin commented 3 months ago

Not OP, but I can confirm removing .css resolves the issue for me