8000 Update getting-started.md · sveltejs/svelte-preprocess@748735d · GitHub
[go: up one dir, main page]

Skip to content 8000

Commit 748735d

Browse files
authored
Update getting-started.md
1 parent 8617b1e commit 748735d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/getting-started.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ $primary-color: red;
216216
As in any SCSS project, we could just `@use './path/to/variables.scss`, but that can also become boring. `svelte-preprocess` [accepts a `prependData`](/docs/preprocessing.md#preprocessors) for almost every processor. Let's use it to prepend our import!
217217

218218
```diff
219-
+ import { posix } from 'path'
219+
+ import path from 'path'
220220
import svelte from 'rollup-plugin-svelte'
221221
import autoPreprocess from 'svelte-preprocess';
222222

@@ -241,7 +241,7 @@ export default {
241241
+ // We need an absolute path here because each component is
242242
+ // preprocessed from its directory.
243243
+ // Obs: must pass a posix-style path to scss
244-
+ prependData: `@use '${posix.resolve(process.cwd(), 'src/styles/variables.scss')}';`
244+
+ prependData: `@use '${path.resolve(process.cwd(), 'src/styles/variables.scss').replace(/\\/g, '/')}';`
245245
+ },
246246
postcss: {
247247
plugins: [require('autoprefixer')()]

0 commit comments

Comments
 (0)
0