-
Notifications
You must be signed in to change notification settings - Fork 12k
fix(@angular-devkit/build-angular): never use component css sourcemap… #15238
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
Conversation
According to @IgorMinar:
|
sourceMap: cssSourceMap | ||
// Never use component css sourcemap when optimizations are on. | ||
// It will just increase bundle size without offering good debug experience. | ||
&& !buildOptions.optimization |
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.
You should actually check it style optimization is enabled. As styles optimization can be disabled.
Ie !buildOptions.optimization.styles
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.
You're right, and that's also what was breaking a server builder test. Thanks!
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.
At the moment you are also disabling sourcemaps when opimizations are turned off.
Optimization is not a boolean but a complex object, users can choose what they want to optimize.
… when optimizations are on. It will just increase bundle size without offering good debug experience.
594f4b2
to
1a6bf21
Compare
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.
LGTM
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.
Should there be some type of information message/warning for this case? It is changing the users settings silently.
Or maybe just a warning that this is not a recommended configuration? Maybe the developer really wants the source maps?
Actually, any reason we can't create file source maps for the component stylesheets? |
I'm not sure if the if the AOT compiler supports non-inline css sourcemaps actually. @IgorMinar @alxhub should we use them? |
Would it matter at the AOT level? It's just a different source map comment url. |
I vaguely remember it mattered for AOT debugging, but not sure anymore. I think that's why we always inline them. |
I think the problem was that when not inlining it didn’t work for a number of use cases.
|
The bundles wouldn't. The injected style elements would each have one. Instead of a data URL they would have a file URL. |
… when optimizations are on. (#15238) It will just increase bundle size without offering good debug experience.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
… when optimizations are on.
It will just increase bundle size without offering good debug experience.