-
Notifications
You must be signed in to change notification settings - Fork 25
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
Can't @use or @forward a file #90
Comments
Ah. I started looking into this myself this morning, thinking I could maybe submit a PR, and discovered that it would actually be quite a lot of work! Since you can't just pass off to Sass itself to do the hard work of bundling, scss-bundle would have to fully implement all the new behaviour of the module system. Off the top of my head:
I'm sure there are other things to add (especially in the area of errors to throw) but already that's got it looking pretty complex. I'd still like to take a pop at it, but if one of the more regular contributors can see a solution and beats me to it, I'll be happy with that too! |
@DaemonExMachina, glad you took a look into this. We departed from using Looking at your last post (it is pretty exhaustive, thanks for that!) it seems that the module system is quite similar to JavaScript / TypeScript ones. Just not sure what does Your observation about If you want to tackle this, please do. We can support you, but having neither financial benefit nor usage in our organization, it's unlikely we are going to implement this very soon. |
Ah yeah, if you haven't been reading up on the new modules some of what I wrote would be absolute gobbledygook! I totally get why this wouldn't be a priority in that case. To be perfectly honest, we're working towards not needing scss-bundle too, but I'm not sure how long that's going to take. There are a few steps to get there, and we may not even go all the way there. Basically, if we can get away with using CSS custom properties (variables) for theming, then we don't need to build a SCSS bundle to export for clients to manipulate to build their own themes. They can just write some overrides for the (many many) CSS variables and attach them to I'm interested in the challenge of making this change, though. Playing with parsers, reading ASTs... yeah, that's something I've always wanted to explore but never had reason to. Every build tool and linting rule I've needed so far has already been built by someone. Just for fun, then: the // _child.scss
$var1: blue !default;
$var2: null !default;
body {
color: $var1;
}
// index.scss
@use 'child' with (
$var1: red,
$var2: green
); It's a concept that already existed: a browse through the Bootstrap stylesheets, for instance, would show lots of those |
Do we anticipate an progress being made on this feature enhancement? If so, is there anything I can do to help? If not, do you know of any good workarounds? In my head, this enhancement would be perfect for my use case, but maybe there is an alternative I am not considering? |
Because it is not compatible with the new `@use` from SASS: reactway/scss-bundle#90 So instead we ship raw SCSS files to be consumed by the app.
This is a blocker for us as well, any plans to resolve this issue? |
@DenysVuika One workaround I found was to create a "set up" file that has only your
It's not a the best solution since you can't have the |
Any updates on this? Is there a workaround? |
Any update on this? |
I've contributed to this repository and can say that without a major refactor/rewrite this feature will never happen. |
we had to completely get rid of this tool and using Angular CLI and synthetic app project to compile the themes so far |
This is till a problem it seems... |
I feel like with the new SCSS module system ( Before:
After:
All the variables and mixins exposed from the children will be available from the root entrypoint. |
Which new SCSS module system are you talking about? |
@pelord see my updated comment |
@dkimmich-onventis This package is for a very particular use-case. The desired end result is a single Take the reason my team was using scss-bundle, for instance (spoiler alert: we don't use it anymore). We were trying to generate an Angular Material theme bundle that could be patched with custom palettes by our clients at deploy-time. They just create a The part that matters here is that that imported
Because I didn't have anywhere near the time to make this change to scss-bundle myself, and no one else seemed likely to do it, I ended up just moving us away from using it. Now, our init-container is filled up with all of |
|
Because it is not compatible with the new `@use` from SASS: reactway/scss-bundle#90 So instead we ship raw SCSS files to be consumed by the app.
Describe the bug
Despite using the latest version of sass, which implements the new module system, scss-bundle won't let me use
@use
or@forward
to import a file. Having just refactored a massive monorepo (136 files touched) to use the new system, this was not a nice thing to see in our Jenkins console.To Reproduce
Steps to reproduce the behavior:
index.scss
and_child.scss
index.scss
write the line@use 'child';
_child.scss
write some basic CSS, likebody { height: 100%; }
index.scss
as the entryFile@use
.@import
, everything works as expected.Expected behavior
I would expect files imported with
@use
or@forward
to be found and bundled correctly.Package version: v3.1.1
Node version: v12.14.1
OS: Windows (but also Bash on the Jenkins box)
The text was updated successfully, but these errors were encountered: