-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
feat(gatsby-plugin-sass): Support Dart SASS #10159
Conversation
Also, I updated the peerDependency |
about What are pros/cons of using |
When it comes to feature they doesn't differ much. It is just a JS implementation of http://sass.logdown.com/posts/1022316-announcing-dart-sass painless maintenance too. In my case I often switch node versions in local environment with nvm. Every time when I do that I have to rebuild |
Okay. Can you Point where the schema is created. |
I'm not sure about removing |
This is how sass-loader is implemented. When the module is not installed |
This isn't exactly graphql schema creation (yet) - it's preparation for it. It get caught in infinite loop in this file: https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/schema/data-tree-utils.js where we traverse objects to create "pristine example" of node shape (which later on will be used to actually construct schema). Problem is our traversing object doesn't handle cyclical references like this: const obj = {
test: 5
}
obj.cyclical = obj
// when traversing object we will get stuck on visiting nested `cyclical` fields
// (obj.cyclical.cyclical.cyclical...) eventually resulting in maximum call stack size
// exceeded error |
@pieh I have updated the pr. once #10177 is merged. everything should just work fine. Just the documentation is updated. Also, node-sass is removed from peerDependency, this is based on how sass-loader works https://github.com/webpack-contrib/sass-loader. Since |
But |
Hi, This is a fix for issue as discussed here #10159 (comment). prevent loop if the object is of type function
@pieh I have reverted the node-sass dependency back |
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.
Thanks @sibiraj-s 🙏
* master: (870 commits) fix(graphql-skip-limit): declare `graphql` peer dependency (gatsbyjs#10305) fix(gatsby-plugin-offline): gracefully degrade if appshell isn't precached (gatsbyjs#10329) Service workers note (gatsbyjs#10276) fix(docs): link fixes, podcast addition (gatsbyjs#10332) feat(docs): Create clearer pathways in docs (gatsbyjs#9898) feat(www): Rename community section to creators (gatsbyjs#10312) docs(graphql-reference): clarify filtering using comma/and operator (gatsbyjs#10321) chore(release): Publish feat(gatsby-plugin-sass): Support Dart SASS (gatsbyjs#10159) fix(gatsby-source-drupal): use basic auth credentials to fetch remote files as well. (gatsbyjs#10302) fix(gatsby-source-filesystem): allow empty password for basic auth in createRemoteFileNode (gatsbyjs#10280) docs(gatsby-remark-prismjs): Use Gatsby V2 project structure (gatsbyjs#10059) chore: update link for react-gatsby-firebase-authentication (gatsbyjs#10314) fix(www): Awesome Gatsby sidebar link (gatsbyjs#10313) Add thijs koerselman to creators list (gatsbyjs#10303) chore(release): Publish fix(gatsby-plugin-emotion): allow for React.Fragment shorthand syntax (gatsbyjs#10291) feat(www): Update starter cards (gatsbyjs#10258) Update index.md (gatsbyjs#10307) Update index.md (gatsbyjs#10306) ...
Hi, This is a fix for issue as discussed here gatsbyjs#10159 (comment). prevent loop if the object is of type function
* feat: support dart sass * fix: handle module not found error * chore: update dart-sass * chore: revert peerDependencies
// in gatsby-config.js
plugins: [
{
resolve: `gatsby-plugin-sass`,
options: {
implementation: require("sass"), // should be "dart-sass" instead, otherwise error
},
},
] |
Feature: Support Dart SASS.
Hi,
Gatsby uses
sass-loader
which supports bothnode-sass
anddart-sass
. This PR enables users to use sass of his choice.Motivation
In the current implementation
gatsby-plugin-sass
sends options directly tosass-loader
. hence the following usage should workbut it throws some error, I am not sure of it yet.
Error Message
But the following works,
Hence the PR to simplify the process.
NOTE:
node-sass
is removed from peerDependencies to let user to use sass of their choice