Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace node-sass with sass (dart-sass) #44

Merged
merged 2 commits into from Nov 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -33,8 +33,8 @@
"dependencies": {
"autoprefixer": "^9.4.8",
"cssnano": "^4.1.10",
"node-sass": "^4.11.0",
"postcss": "^7.0.14"
"postcss": "^7.0.14",
"sass": "^1.29.0"
},
"devDependencies": {
"chai": "^4.2.0",
Expand Down
7 changes: 3 additions & 4 deletions src/sass.js
@@ -1,7 +1,6 @@
'use strict'

const util = require('util')
const sass = require('node-sass')
const sass = require('sass')

/**
* Transform SASS to CSS.
Expand All @@ -19,10 +18,10 @@ module.exports = async function(folderPath, str, opts) {
// Dismiss sourceMap when output should be optimized
const sourceMap = opts.optimize !== true

const result = await util.promisify(sass.render)({
const result = sass.renderSync({
data: str,
includePaths: [ folderPath ],
sourceMap: sourceMap,
sourceMap: sourceMap ? '' : false,
sourceMapEmbed: sourceMap,
sourceMapContents: sourceMap
})
Expand Down