Skip to content

Commit d8b7b5a

Browse files
committed
fix: properly use indentedSyntax for sass files
Fixes #159
1 parent 855d24f commit d8b7b5a

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/sass.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ export default function setupSass (this: ModuleThis, options: Pick<Options, 'cus
1212
this.options.build!.loaders.scss.implementation =
1313
dartSass
1414

15+
// Ensure it uses indented syntax for Sass files
16+
this.options.build!.loaders.sass.sassOptions = this.options.build!.loaders.sass.sassOptions || {}
17+
this.options.build!.loaders.sass.sassOptions.indentedSyntax = true
18+
1519
// Custom variables
1620
if (options.customVariables && options.customVariables.length > 0) {
1721
const imports = options.customVariables.map(path => `@import '${path}'`).join('\n')

test/module.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ describe('setupSass', () => {
8787

8888
expect(nuxt.options.build.loaders.sass.indentedSyntax).toBeUndefined()
8989
expect(nuxt.options.build.loaders.sass.implementation).toEqual(dartSass)
90+
expect(nuxt.options.build.loaders.sass.sassOptions.indentedSyntax).toBe(true)
9091
expect(nuxt.options.build.loaders.scss.implementation).toEqual(dartSass)
9192
})
9293

0 commit comments

Comments
 (0)