feat: Add support for webpack style import from node_modules.#122
feat: Add support for webpack style import from node_modules.#122lukasholzer wants to merge 1 commit into
Conversation
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
|
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'; |
nex3
left a comment
There was a problem hiding this comment.
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.
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