Open sveetch opened 5 years ago
For sanity, i checked compilation with Foundation, Bootstrap and Bulma from their node modules and everything is fine for compile and watch mode.
But as stated from issue detail, an exception is raised for conflicts, if the Sass project import Foundation and also contains a components/_badge.scss
file, it make a conflict with the one from Foundation.
Plan:
base_modules
for a path to search from import pattern, not sure for final implementation with the introspection. If need it will be move to a distinct issue to avoid blocking this one;
Currently Boussole is very strict about import resolution: it refuses to compile sources which have import path that resolve to more than one source.
Note this is only an issue with "watch" mode which make introspection on Sass sources to find main sources to rebuild. With the "compile" mode, there is not introspection and this libsass which does everything, no boussole code is involved in import resolution.
Current behavior
If a source contains
@import "foo"
and there arefoo.css
andfoo.scss
files, it raises an error about unclear resolution sincefoo
can be understood asfoo.css
orfoo.scss
. This can happen also with identical source file (relative) path with included libraries.Expected behavior
This is not the way other compiler works especially node-sass. Even Sass documentation define another behavior: https://sass-lang.com/documentation/at-rules/import#load-paths
Also, we should fit to the node-sass behaviors so Boussole could be a valid replacement. And so we may have to implement the "~" behavior which seek for path from "node_modules" which path will have to be configured in settings.
Filename in current directory win against similar names from include libraries. This should be the default behavior to adopt (and strict could stay as an option).
Still there is some details to study to go further:
This must not replace the current import behavior and must be introduced as a new optional resolution engine (depending a setting?) and current behavior will still be the default one for some time as a deprecation process.