Skip to content

Commit 0edab05

Browse files
committed
Upgrade from node-sass to sass
1 parent 3199225 commit 0edab05

File tree

3 files changed

+187
-1024
lines changed

3 files changed

+187
-1024
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
"dependencies": {
99
"highlight.js": "^9.15.6",
1010
"moment": "^2.24.0",
11-
"node-sass": "^6.0.0",
1211
"pug": "^2.0.3",
1312
"remarkable": "^1.7.1",
14-
"rimraf": "^2.6.3"
13+
"rimraf": "^2.6.3",
14+
"sass": "^1.83.4"
1515
},
1616
"devDependencies": {
1717
"eslint": "^5.16.0",

util/compileSass.mjs

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
import fs from 'fs'
2-
import { promisify } from 'util'
32
import path from 'path'
4-
import sass from 'node-sass'
3+
import sass from 'sass'
54

65
const fsPromises = fs.promises
7-
const renderSass = promisify(sass.render).bind(sass)
86

97
export default async (stylesPath, publicPath) => {
10-
const result = await renderSass({
11-
file: path.join(stylesPath, 'style.scss'),
12-
})
8+
const result = await sass.compileAsync(path.join(stylesPath, 'style.scss'))
139

1410
const fileHandle = await fsPromises.open(path.join(publicPath, `style.css`), 'w')
1511
await fileHandle.write(result.css)

0 commit comments

Comments
 (0)