-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Css loading complexity in angular app #2688
Comments
Agree 💯 We have absolutely no preference in the webpack config ourselves in regards to css, we add things so most users have maximum convenience. |
@igor-dv I'm very interested in this issue.
The webpack configuration created by Angular CLI is too complex. So it's not easy to extend I think Storybook should provide the way to configure webpack Angular CLI based project. And I've created the helper function for PoC: |
@Quramy , looks promising ! Don't you think it's better to make it as a default behavior? So nobody will need to extend webpack.config? |
@igor-dev Absolutely yes, I do 😄 I hope the following behavior:
|
@alterx Thanks for your feedback. I'll create this as a PR in this weekend ! |
Perfect @Quramy, let us know if we can help |
Merged and released, fix available in https://github.com/storybooks/storybook/releases/tag/v3.4.0-alpha.5 |
I would like to discuss here the problem we have with the css loading complexity for the angular app.
As I understand from the recent issues, there are several flows of loading css to the app
(Related issues: #2647, #2629, #2616)
Global Import
Example:
or even in the
config.js
Storybook should add it to the style tag in iframe
With the "styleUrls"
Example:
In this case, it should be loaded via
raw-loader
, and angular will add it as it wishes:The problem
Our angular app includes two rules for css:
1, in webpack.config.js:
2, in defaults/webpack.config,js:
And we are getting some collision between these rules, so people need to extend webpack.config.js in order to get their angular components work in Storybook (Example )
IMO extending webpack.config.js should be for some specific/rare usecases, but not for the common usage.
@storybooks/team WDYT?
The text was updated successfully, but these errors were encountered: