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..)