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
Angular Universal build includes Source Maps from Component CSS/SCSS in built .html #12940
Comments
I have the same problem. I can confirmed that |
Hi, taking a look at the reproduction. You are not specifying That said this is a bug and we should not output source maps in inline styles, as they are unusable. |
Hi Alan, Thank you very much! |
Actually thinking about it, we should probably have sourcemaps for non bootstrapped apps. That said, it’s a bummer if you want to enable sourcemaps to have better stack traces in your error reporter. But this applies also for the client bundle as component styles sourcemaps are always embedded. |
Keeping |
…rsal production config - When using Universal sourceMaps should not be enabled or at least `styles` sourceMaps should be disabled as these will otherwise be inlined and will be set as apart of the server side rendered page. - While there is no benefit to optimize the scripts at server level, styles should always be minified so that the server side rendered page is smaller. Fixes #12541 and Fixes #12940
I had this: projects": {
"myProjectName": {
...
"architect": {
"build": {
...
"configurations": {
"production": {
...
"sourceMap": false,
...
}
"serve": { ... }
... but you need to include it under "server" projects": {
"myProjectName": {
...
"architect": {
"build": { ... },
...
"server": {
...
"configurations": {
"production": {
...
"sourceMap": false,
... that fixed it for me. |
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 or Feature Request (mark with an
x
)Command (mark with an
x
)Versions
Angular CLI: 7.0.4
Node: 8.12.0
OS: win32 x64 / Windows 10
Angular: 7.0.3
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router
Package Version
@angular-devkit/architect 0.10.4
@angular-devkit/build-angular 0.10.4
@angular-devkit/build-optimizer 0.10.4
@angular-devkit/build-webpack 0.10.4
@angular-devkit/core 7.0.4
@angular-devkit/schematics 7.0.4
@angular/cli 7.0.4
@ngtools/webpack 7.0.4
@schematics/angular 7.0.4
@schematics/update 0.10.4
rxjs 6.3.3
typescript 3.1.6
webpack 4.19.1
Repro steps
Minimal Reproduction in repo: https://github.com/visurel/angular-universal-issue-repro
Run
npm run build:ssr && npm run serve:ssr
and check the source code of the localhost:4000 result.The log given by the failure
Desired functionality
After upgrading from Angular 6 to Angular 7 I noticed sourceMaps from CSS/SCSS encoded in base64 get added to the Angular Universal build results. Above is the output with a single .css file for a component. When having dozens of components, these sourceMaps get huge and increase .html size unnecessarily.
I'd like to remove these
sourceMappingURL=data:application/json;base64
blocks from my Universal builds.Mention any other details that might be useful
The text was updated successfully, but these errors were encountered: