Skip to content
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: Add support for webpack style import from node_modules. #122

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lukasholzer
Copy link

To enable the support I had to switch to the JavaScript API https://sass-lang.com/documentation/js-api#rendersync as it is already orchestrated via javascript.
This enables the possibility of specifying importers that can resolve custom import paths.

Fixes #98

To enable the support I had to switch to the JavaScript API as it is already orchestrated via javascript.
This enables the possibility of specifying importers that can resolve custom import paths.

Fixes bazelbuild#98
@lukasholzer
Copy link
Author

Sorry for the formatting changes but my buildifier formatted it. 😬

@jelbourn any opinions on how to add node_modules with a scss dependency only for the examples or tests to showcase the webpack flavour import:

@import '~@angular/cdk/overlay';

Copy link
Collaborator

@nex3 nex3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is a desirable change. Moving from invoking the executable function to invoking the JS API causes a number of issues, including a substantial amount of new code we need to maintain and much higher friction synchronizing this into Google (where we use the Dart executable instead). It also bakes in one particular importer scheme rather than giving users the flexibility to define custom importers—although that would also add a considerable amount of complexity.

I think the principled way to address this use-case is with sass/sass#2739, which would provide a consistent syntax for package imports that wouldn't need to be maintained ad hoc in a Bazel package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add example of how to import from Angular Material's SASS stylesheets
2 participants