sass / dart-sass

The reference implementation of Sass, written in Dart.
https://sass-lang.com/dart-sass
MIT License
3.9k stars 352 forks source link

Standalone sass compiler: Can't find stylesheet to import #2165

Closed m-nic closed 7 months ago

m-nic commented 7 months ago

I'm trying to use the standalone compiler for existing code that has style dependencies on a number of npm packages. The command looks like: sass --load-path=node_modules src/styles/app.scss public/app.css

I encounter the following error: Error: Can't find stylesheet to import. @import "~/boostraps-sass/assets/stylesheets/bootstrap/variables" I understand the ~ is not something specific to sass and some other posts mention it could be solved via custom importer, but that seems to be available only in the js api. Is there a way to fix the issue without having to change the existing code?

Thank you!

Goodwine commented 7 months ago

Hi there! As you mentioned, you must use a custom Sass importer in order to make this work. The standalone Sass compiler doesn't support this feature.