Closed cschwaderer closed 4 years ago
Hi @cschwaderer, thanks for reporting this.
From what I can tell all style tags with the server-transtition
attribute are the ones which are referenced by the components of the current page. Is it possible that some of your components reference some other CSS files which do contain the large source map?
That's just a wild guess of course. Please let me know in case the project is publicly available somewhere. I'm happy to take a look.
Hi @cschwaderer, could you determine what caused the problem?
@chrisguttandin Unfortunately not. At least not immediately and now I'm busy with different matters. This is still an open issue on my list, but not high priority right now.
Thanks for the feedback. I will keep this issue open for another while. But I'm afraid there is not much I can do without an example project that reproduces the problem.
This issue can be closed.
The reason for the huge file was a CSS framework being imported into each component anew, thus creating huge files anyway. So, this has nothing to do with angular-prerender. Sorry.
Thanks for double-checking this.
In my Angular 8 project, when running
ng build --prod
everything seems to work fine. I havesourceMap
set tofalse
inangular.json
, and indeed no source map files are created. Mystyles... .css
file is just 170kb largeHowever, after running
npx angular-prerender
, the result seems somewhat weird. My index.html is now 6,4mb large. The content consists mainly of CSS. While the<body>
of this HTML page is quite small (18kb), the header is huge. Namely, there are eight<style>
tags all starting like<style ng-transition="serverApp">
Every<style>
tag has a source map comment in base64 format starting like/*# sourceMappingURL=data:application/json;base64...
All these comments are in sum ca 5MB large.The rest of the
<head>
is plain CSS (which somehow seem repetitive), so ca. 1.8MBMy questions are now:
sourceMaps
are turned off inangular.json
?