-
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
[1.3.0-rc.0] Sourcemaps seem borken when using new build optimizer #7093
Comments
Thanks a lot for the quick response, you guys are rly doing a great job! As for the size differences.. I guess you are refering to the vendor chunk disbaled/enabled option. I checked the actual size of the files for that (
Not that big a difference (for this example at least) |
I digged into the sourcemaps and we're definitely breaking them somewhere, and also the default was broken (prod build should have it turned off by default). It's cool to see that the VC didn't make much of a difference in your setup. In another setup (angular.io actually) it made a huge difference. About 40% of the total savings were gone by having the VS. But I hope that webpack improvements in scope hoisting might bring that down. It's something we'll keep monitoring. |
@filipesilva Good point you've got there it slipped my mind that they are disabled by default... And you are quite right about the vendor chunk size at aio. I tried it with the version you commited with the new CLI and I'm getting the same differences in size you've mentioned. Not sure why though... |
Your findings corroborate what I've been seeing as well. I think it's wholly related to scope hoisting and the current status of angular material tree shaking (angular/components#4137). So by itself material is not tree-shaked properly; but with scope hoisting + uglify + build-optimizer, parts of it are. Scope hoisting is very important here as it helps uglify drop more stuff. When you have a vendor chunk, there should be at least 2 scope hoisting contexts (one for main, or for vendor). Having them separated reduces gains by not allowing uglify to drop as much. This seems to be more important when the code is stuff to which build optimizer adds annotations (downleved TS code and angular specific code). So when you have a lot of angular libs in the same chunk, more is saved. If you have a lot of stuff that the build optimizer doesn't touch, the difference isn't as dramatic. |
I see, great explanation thanks al lot 👍 |
Hi @filipesilva, I'm not sure if this is related to this error, but now source map explorer is working again, but I get strange results in the reported sizes. |
Will look at it, reopening. |
@ianchi with
I also tried So there's always a difference, I'm not sure why. The difference without But the difference in prod is around half the size. It seems related to either uglification or webpack concatenated modules (that's what changes in production). @TheLarkInn do you have any insight on this? |
Looks like an old issue. Closing it for now. If it's not resolved, feel free to open a new one with details and demo where we can reproduce the problem. |
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. |
First of big thanks to @filipesilva for adding the
--build-optimizer
! It saved about 200kb (non gzip) in overall size on a blank project with material and about 500kb on a production one, good job 👍(as a note: up until now I could not see any real size difference when enabling the vendor chunk again, always <1kb)
Bug Report or Feature Request (mark with an
x
)Versions.
on Windows 10
Repro steps.
Install latest
@angular/cli@1.3.0-rc.0
,generate a new project and
run
ng build --prod --bo --oh=none --vendor-chunk=true
. (same goes when vendor chunk is disabled)change to
dist
and runsource-map-explorer vendor.bundle.js
(same forwebpack-bundle-analyzer
)or use https://github.com/bboehm86/mat-chunk-test
run
npm run build:bo:vc
The log given by the failure.
No failure but just no usable informations for vendor files (there should be angular, angular material and rxjs inside)
Desired functionality.
It would be nice if still could still have usabe sourcemap infos to take a look into our bundle and see whats inside :-)
The text was updated successfully, but these errors were encountered: