I have the following structure for a web component:
-moduleA
-node_modules
-my-sass-package-a
-node_modules
-my-sass-package-b
_my-partial.scss
package.json
_my-partial.scss
package.json
styles.scss
package.json
In styles.scss I import a SCSS asset from my-sass-package-a
:
@import 'my-sass-package-a/my-partial';
In my-sass-package-a/my-partial
I import my-sass-package-b:
@import 'my-sass-package-b/my-partial';
sass-loader throws the following error (bur the error is really coming from the blackbox that is node-sass
)
SassError: File to import not found or unreadable: my-sass-package-b/my-partial
The following SOs do not help and are not specifically addressing my context/case:
- https://stackoverflow.com/a/35018624/1258525 (this one does not work because they are hard coding the nested depth package, I cannot hard code "my-sass-package-b" into my
includePaths
- Importing Sass through npm (this one is not working with SASS npm packages but relative SASS assets)
This is issue is one of depth resolution in a nested dependencies.
- Is there a way to hook into node-sass resolution and provide hints to look in nested node_module at each resolution root context?
- Is there a way to change node-sass options to recursively look for SASS packages in nested
node_modules
without harding codingmy-sass-package-b
into myincludePaths
, again this is not an option for me. (I do not see a node-sass option that help my scenario)
- Is there a way to change node-sass options to recursively look for SASS packages in nested