Open
Conversation
- Replace node-sass with sass - Remove vue-hot-reload-api
salomoneb
commented
May 15, 2024
Comment on lines
-94
to
-97
| var prevParts = resolvedPartsCache[id] || {} | ||
| resolvedPartsCache[id] = resolvedParts | ||
| var scriptChanged = resolvedParts.script !== prevParts.script | ||
| var templateChanged = resolvedParts.template !== prevParts.template |
Author
There was a problem hiding this comment.
These vars were used by the hot reload code below and aren't referenced now.
| } | ||
| ) | ||
| try { | ||
| let res = sass.renderSync(sassOptions) |
Author
There was a problem hiding this comment.
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.
| module.exports = function (raw, cb, compiler, filePath) { | ||
| ensureRequire('sass', 'node-sass') | ||
| var sass = require('node-sass') | ||
| ensureRequire('sass', 'sass') |
Author
There was a problem hiding this comment.
I don't know if this is actually necessary, but I didn't want to rewrite too much right now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Changes so that we can upgrade to Node 21.
node-sasswithsass.vue-hot-reload-api.Testing
Local testing is a little tricky since we're working with nested dependencies.
In the
clayclidirectory that is using this package:@nymag/vueifyversion value with"@nymag/vueify": "file:<path-to-your-local-vueify>". On my setup, this looks like:rm -rf package-lock.json node_modulesnpm ipackage-lockandnode_modulesthere 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.