Skip to content

Commit d327e5a

Browse files
committed
fix(scss): use sass.compile(file) & sass.compileString(string) instead of deprecated render
1 parent 05aacff commit d327e5a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/utils/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ export async function getContent(file: string) {
6262
}
6363

6464
if (ext === 'scss') {
65-
const output = sass.renderSync({ file, outputStyle: 'expanded' })
66-
content = output.css.toString()
65+
const output = await sass.compileAsync(file, { style: 'expanded' })
66+
content = output.css
6767
}
6868
}
6969

@@ -73,8 +73,8 @@ export async function getContent(file: string) {
7373
content = output.css
7474
}
7575
if (ext === 'scss') {
76-
const o = sass.renderSync({ data: content })
77-
content = o.css.toString()
76+
const output = await sass.compileStringAsync(content, { style: 'expanded' })
77+
content = output.css
7878
}
7979
}
8080

0 commit comments

Comments
 (0)