-
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?
Conversation
- Replace node-sass with sass - Remove vue-hot-reload-api
var prevParts = resolvedPartsCache[id] || {} | ||
resolvedPartsCache[id] = resolvedParts | ||
var scriptChanged = resolvedParts.script !== prevParts.script | ||
var templateChanged = resolvedParts.template !== prevParts.template |
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.
} | ||
) | ||
try { | ||
let res = sass.renderSync(sassOptions) |
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.
render
is deprecated and not recommended if you're using sass
via npm. I replaced it with renderSync
, which takes the same LegacyOptions
param. renderSync
returns a result or throws an error, so I wrapped everything in a try..catch
to handle the callbacks.
@@ -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 comment
The 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.
Description
Changes so that we can upgrade to Node 21.
node-sass
withsass
.vue-hot-reload-api
.Testing
Local testing is a little tricky since we're working with nested dependencies.
In the
claycli
directory that is using this package:@nymag/vueify
version value with"@nymag/vueify": "file:<path-to-your-local-vueify>"
. On my setup, this looks like:rm -rf package-lock.json node_modules
npm i
package-lock
andnode_modules
there as well. I found that the build would hang indefinitely if there were conflicts.If you're using claycli version
"5.1.0-0"
, I don't think you need to make any changes to that repo for this to work.