Solve sass dependencies import parths #10
Labels
bug
external-dependency
Depends from third party tools that we use to build this framework
help wanted
Note: this issue is only seen while importing
@whitemsith/qnorr-styles/scss/qnorr.scss
in some specific contexts. Check this comment for explanationdescription
We have two external dependencies
mappy-breakpoints
andnormalize.css
and they are both imported atqnorr.scss
This will of-course fail when our package is imported from other websites, that don't have
node_modules
path resolving. So the path will be:node_modules/@whitesmith/qnorr-styles/node_modules/mappy-breakpoints/_mappy-breakpoints
Possible workarounds (there's no solution, at least i couldn't found one)
We can beautify this using custom importers for
node-sass
and have pretty paths, but then we assume that the parent project need to have that configuration.Apparently there's no de facto solution of module resolving for sass modules. the tilde
~
is the most default at webpack | parcel but there people that use@
as alias as well so we could never know.A list of current workarounds:
vendor
folderAdd a sass variable to customize the path prefix ("~", "@", "./node_modules)edit: this unfortunatelly is not possibleSass Issues to track
Related issues and links for study
-webpack-contrib/sass-loader#479
The text was updated successfully, but these errors were encountered: