79230570

Date: 2024-11-27 13:54:58
Score: 1
Natty:
Report link

2024-update: The loadPaths answer provided by decho is still relevant: With webpack, I had to write my sassOptions like this:

..
const outerDir = path.resolve(__dirname, '.');
   ..
        sassOptions: {
            includePaths: ["node_modules"],
            loadPaths: [outerDir], // (js var outerDir contains an absolute path to somewhere in my source folders.)
        }
   ..

This is highly non-intuitive, because all the documentation and guides I had read suggested includePaths would control this aspect??

The context of this is that I have a local CSS folder structure, and I don't want to use weird relative '../../ ... ' import paths. It used to work without loadPaths, but broke presumably when I upgraded to sass 1.81.0 (?) somewhere along the way.

I wasted a lot of time looking at webpack resolve rules, module rules, and aliases. I still wonder if I could have solved it with those techniques instead (no luck..)

Reasons:
  • Blacklisted phrase (1): no luck
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (0.5):
Posted by: jakob gaardsted