Skip to content

Commit 64ff96a

Browse files
authored
(docs) SCSS includePaths troubleshooting
#520
1 parent 0ecc52c commit 64ff96a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/preprocessors/scss-less.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,16 @@ Hit `ctrl-shift-p` or `cmd-shift-p` on mac, type `svelte restart`, and select `S
6666
### SCSS: Using node-sass and having errors?
6767

6868
The `node-sass` package is very sensitive to node versions. It may be possible that this plugin runs on a different version than your application. Then it is necessary to set the `svelte.language-server.runtime` setting to the path of your node runtime. E.g. `"svelte.language-server.runtime": "/<LOCAL_PATH>/bin/node"`.
69+
70+
### SCSS: Using `includePaths` does not work
71+
72+
If you use `includePaths` with relative paths, those paths will be resolved relative to the node process, not relative to the config file. So if you `svelte.config.js` is within `frontend`, the path `theme` will _NOT_ resolve to `frontend/theme` but to `<node process root>/theme` (which might be the same as `frontend`). To ensure it always resolves relative to the config file, do this:
73+
74+
```js
75+
const sveltePreprocess = require('svelte-preprocess');
76+
const path = require('path');
77+
78+
module.exports = {
79+
preprocess: sveltePreprocess({ includePaths: [path.join(__dirname, 'relative/path')] })
80+
};
81+
```

0 commit comments

Comments
 (0)