maoberlehner / node-sass-magic-importer

Custom node-sass importer for selector specific imports, module importing, globbing support and importing files only once.
MIT License
292 stars 28 forks source link

package-importer doesn't find packages from other packages #232

Open dietergeerts opened 3 years ago

dietergeerts commented 3 years ago

My node modules don't get installed in a flat tree, but as an actual dependency tree where only the ones that are specified are installed, which is very good (I use pnpm) So the package structure I have is:

- my-package
|- node_modules
  |- my-toolkit
    |- node_modules
      |- bootstrap

Because of this, the importer can't find the bootstrap imports declared in the toolkit scss files, as it always starts searching from the cwd and not from the file that is asking for the import, which is a node_modules deeper. The importer should check which file loaded it (https://sass-lang.com/documentation/js-api#importer) and based on that set the starting directory to search in.

(another issue I encounter is that index.scss isn't resolved if you only state the directory, which does work normally with sass and sass-loader)

mpdude commented 2 years ago

Is that a duplicate of #188?