You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to find out how, exactly, Dart Sass resolves ambiguous imports. I've looked through the source, but I can't really extract the exact search order.
But that does not indicate where CSS files fit into the process. The Dart Sass docs for @use say that the compiler will import CSS files as a last resort.
Given a base file that has this:
// Base File named "something.scss" in /someFolder
@use 'foo';
What is the precise order Dart Sass uses to resolve this? My best guess is:
/someFolder/foo
/someFolder/_foo
/someFolder/foo.scss Extension matching base file's ext.
/someFolder/_foo.scss
/someFolder/foo.sass
/someFolder/_foo.sass
/someFolder/foo/_index.scss Extension matching base file's ext.
/someFolder/foo/_index.sass
/someFolder/foo.css
/someFolder/_foo.css
Repeat the process for every load-path until something matches.
Is this correct? The entries in (3) and (7) use the base file's extension first and the alternate syntax extension as the next attempt.
The reason the exact order matters to me is that I need to build a dependency graph between files so I know which ones to re-compile when imported files change.
The text was updated successfully, but these errors were encountered:
I've been able to determine that Dart Sass does not resolve (1) or (2). A file must have an extension for Dart Sass or the compiler won't resolve to it.
Libsass, however, does.
I think this might be because there is not, as far as I know, a spec that definitively outlines the exact resolution process to follow. Would it be possible to get that? Once it's available, we could probably get Libsass and Dart Sass standardized on the same set of rules.
I'm trying to find out how, exactly, Dart Sass resolves ambiguous imports. I've looked through the source, but I can't really extract the exact search order.
I've seen this from Libsass: https://github.com/sass/libsass/blob/951500818a7820783a991313cdbe5862a57e2d51/src/file.cpp#L329
But that does not indicate where CSS files fit into the process. The Dart Sass docs for
@use
say that the compiler will import CSS files as a last resort.Given a base file that has this:
What is the precise order Dart Sass uses to resolve this? My best guess is:
Extension matching base file's ext.
Extension matching base file's ext.
load-path
until something matches.Is this correct? The entries in (3) and (7) use the base file's extension first and the alternate syntax extension as the next attempt.
The reason the exact order matters to me is that I need to build a dependency graph between files so I know which ones to re-compile when imported files change.
The text was updated successfully, but these errors were encountered: