-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Angular: Include object configured styles #24768
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
@valentinpalkovic hi. I think there is a slight mistake here since first you use
mapto take the string, but thefilterwill always have a string. Now objects with"inject": falsewill not be included in the build as separate files, now they will always be in themain.cssfileThere 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.
Hi @andriy-statsenko-lightit
Thank you for pointing this out. You're right! Fix incoming: #27108
Uh oh!
There was an error while loading. Please reload this page.
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.
@valentinpalkovic Thanks for the answer. It’s also worth noting that even if you swap the
filterandmap, files with“inject”: falsewill not be included in the final build as separate files. 🤔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.
Maybe I misunderstood the
injectproperty in the past. Are you saying we shouldn't filter at all, butinjectonly means whether the CSS is bundled in or outputted as a separate file?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.
Ok so

inject: falsejust excludes the bundle from the injection toindex.htmlfile, but the file will remain in the folder.inject: trueincludes the file toindex.html. Example:As I understand it, the problem was that files with
inject: truewere not included in theindex.htmlfile or were not included in themain.cssfile (not knowing exactly how the storybook builder works). After this fix, they will now be in themain.cssfile, but files withinject: falsewill not be created at all in the build (dist) folder.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.
Yeah, if there is an object, it works ok, but if there is a path as a string, then files with

“inject”: falsesimply do not appear indistfolder. This is interestingWith string path:

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.
But that's great. Then I can kind of revert the work of this PR and do an internal mapping of styles defined as strings to the object notation. For the user, nothing changes, but things seem to work then!
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.
Yeah, it sounds like a great idea 🙂
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.
I've put together a fix here: #27108
@andriy-statsenko-lightit Would you mind to test the following canary release and give me some feedback?
0.0.0-pr-27108-sha-2470133aThere 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.
@valentinpalkovic yeah, it works fine with different
stylesarrays: string only, string + objects, and objects only. Thanks!