shakacode / sass-resources-loader

SASS resources (e.g. variables, mixins etc.) loader for Webpack. Also works with less, post-css, etc.
MIT License
982 stars 66 forks source link

feat: adopt @use syntax to support new Sass module system #111

Closed lucpotage closed 4 years ago

lucpotage commented 4 years ago

This definitely requires additional work but I hope you can find some time to test this PR and improve it. Thank you in advance.

I didn't bumped the npm version.


This change is Reviewable

justin808 commented 4 years ago

@lucpotage Any chance that you can take a look at my comments?

lucpotage commented 4 years ago

@justin808 I checked how the webpack sass-loader works and it seems they resolve the implementation based on the chosen dependency. What about doing the same?

The sass docs says:

Sass will gradually phase it out over the next few years, and eventually remove it from the language entirely.

What is not clear to me is whether we should force the use of @use in case you have the newest sass dependency whereas @import is clearly not yet deprecated.

Do you think adding a loader option rule would make sense? With @import or @use possible values and @use by default to follow the recommendation.

{
  loader: 'sass-resources-loader',
  options: {
    rule: '@use', // or @import
  },
}

Getting feedback from @nex3 would help.

justin808 commented 4 years ago

@lucpotage I like your last idea. Can you take a try at implementing it?

justin808 commented 4 years ago

@lucpotage did you see my previous comment?

lucpotage commented 4 years ago

Yes and I would like to try at implementing it but I definitely don't have the time right now. 😞

justin808 commented 4 years ago

We've got some merge conflicts. And some CI issues.

Let me know when this is ready.

@lucpotage and @FloEdelmann, thank you for your efforts! Feel free to email me justin@shakacode.com. I've got a slack channel for this as well. You can find the link for Slack here: https://www.shakacode.com/open-source-projects.

justin808 commented 4 years ago

See #117.