1

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:

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 coding my-sass-package-b into my includePaths, again this is not an option for me. (I do not see a node-sass option that help my scenario)
Brian Ogden
  • 18,439
  • 10
  • 97
  • 176

0 Answers0