-
Notifications
You must be signed in to change notification settings - Fork 12k
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 sourcemap files aren't produced #22834
Comments
Hi @JWess, I tried this locally and I wasn't able to replicate as for my case the return (
(e.ɵfac = function (n) {
return new (n || e)();
}),
(e.ɵcmp = qi({
type: e,
selectors: [["app-root"]],
decls: 0,
vars: 0,
template: function (n, r) {},
styles: ["a[_ngcontent-%COMP%]{color:#fff}"],
})),
e
); |
@alan-agius4 I will try to recreate this in an online editor. I took a look at https://github.com/angular/angular-cli/blob/master/packages/angular_devkit/build_angular/src/webpack/configs/styles.ts. It is a bit misleading to me that the sourcemap for global styles is still generated ( |
This is expected although I do agree with you that this is confusing. Let me bring it up with the team. |
I was FINALLY able to reproduce the issue using a freshly-generated app. Here are the very simple reproduction steps:
|
We have discussed this during our team meeting and we have determined that this is what needs to happen;
|
Thanks for the report! When you say "add support for external CSS", that refers to what exactly? Will you be creating that Issue? Thanks again for your prompt effort on all of this. |
Basically what it means is, add support for CSS sourcemaps for components when optimization is enabled which can be done by instead of inline sourcemaps as base64 in the JS file we emit the sourcemap as an external file. I'll be opening the feature request issue in the next couple of days. |
Did this feature request issue ever get created? |
@alan-agius4 Did this get lost in the shuffle? |
…emaps are not generated when styles optimization is enabled With this change we add a warning to inform the users that sourcemaps are not generated when both styles sourcemaps and optimization are enabled. This is because component style sourcemaps are inline which would drastically increase the bundle size. Closes angular#22834
…emaps are not generated when styles optimization is enabled With this change we add a warning to inform the users that sourcemaps are not generated when both styles sourcemaps and optimization are enabled. This is because component style sourcemaps are inline which would drastically increase the bundle size. Closes angular#22834
…emaps are not generated when styles optimization is enabled With this change we add a warning to inform the users that sourcemaps are not generated when both styles sourcemaps and optimization are enabled. This is because component style sourcemaps are inline which would drastically increase the bundle size. Closes angular#22834
…emaps are not generated when styles optimization is enabled With this change we add a warning to inform the users that sourcemaps are not generated when both styles sourcemaps and optimization are enabled. This is because component style sourcemaps are inline which would drastically increase the bundle size. Closes #22834
…emaps are not generated when styles optimization is enabled With this change we add a warning to inform the users that sourcemaps are not generated when both styles sourcemaps and optimization are enabled. This is because component style sourcemaps are inline which would drastically increase the bundle size. Closes #22834 (cherry picked from commit c83aaed)
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. |
🐞 Bug report
Command (mark with an
x
)Is this a regression?
I don't believe so, but I'm not for sure on that.
Description
When building with
angular.json
=>{ sourcemaps: true, optimization: true }
(more specificallyoptimization.styles.minify: true
), CSS sourcemap comments inmain.*.js
point to a non-existent*.component.css.map
file:The corresponding
footer.component.css.map
file is not created by the build.Here is an example of an example app containing a FooterComponent built with four different
optimization
build settings inangular.json
(but sourcemaps turned on in all four cases):No
footer.component.css.map
file is ever created. When the app source code is viewed in Chrome Dev Tools, it tries and fails to load the non-existant CSS sourcemaps.🔬 Minimal Reproduction
Build using
angular.json
:🌍 Your Environment
The text was updated successfully, but these errors were encountered: