-
Notifications
You must be signed in to change notification settings - Fork 2
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
Updates for Node 21 upgrade #3
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,8 @@ var path = require('path') | |
var ensureRequire = require('../ensure-require.js') | ||
|
||
module.exports = function (raw, cb, compiler, filePath) { | ||
ensureRequire('sass', 'node-sass') | ||
var sass = require('node-sass') | ||
ensureRequire('sass', 'sass') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know if this is actually necessary, but I didn't want to rewrite too much right now. |
||
var sass = require('sass') | ||
|
||
var sassOptions = assign({ | ||
data: raw, | ||
|
@@ -28,18 +28,13 @@ module.exports = function (raw, cb, compiler, filePath) { | |
? sassOptions.includePaths.concat(paths) | ||
: paths | ||
|
||
sass.render( | ||
sassOptions, | ||
// callback for node-sass > 3.0.0 | ||
function (err, res) { | ||
if (err) { | ||
cb(err) | ||
} else { | ||
res.stats.includedFiles.forEach(function (file) { | ||
compiler.emit('dependency', file) | ||
}) | ||
cb(null, res.css.toString()) | ||
} | ||
} | ||
) | ||
try { | ||
let res = sass.renderSync(sassOptions) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
res.stats.includedFiles.forEach(function (file) { | ||
compiler.emit('dependency', file) | ||
}) | ||
cb(null, res.css.toString()) | ||
} catch (err) { | ||
cb(err) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These vars were used by the hot reload code below and aren't referenced now.