You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 4, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 4, 2025. It is now read-only.
I was under the impression UglifyES (or whatever NG version of uglify) was doing a proper job at DCE on ES2015 code and that we wouldn't need build optimizer for those.
Note: now we have Angular Elements, support for ES2015 becomes more important, because transpiling custom elements to ES5 is not supported by the standard and produces an error.
As you can see it is ~200k less with build optimizer enabled. Not sure if it is real gain or a side effect of build optimizer removing not dead code, but this looks like a lot of gain. Most of it comes from Angular packages (~180k).
As a work-around, I switched off build-optimiser and the app is working.
With build-optimiser ON, the error is as documented in the "issue comment" at the top of this comment.
@StephenFluin ... things like the Google crawler don't support ES2015
thank you for this, it's the first time i'm hearing of it. unfortunately except for discussions about this being an issue i can't find anywhere a discussion about the status to fix this.
do you know if there is an open thread in github (or someplace else) discussing the fix? i would like to follow it
Activity
robwormald commentedon May 4, 2018
Should also support ES2015 code (really, it should support esnext)
hansl commentedon May 5, 2018
I was under the impression UglifyES (or whatever NG version of uglify) was doing a proper job at DCE on ES2015 code and that we wouldn't need build optimizer for those.
cyrilletuzi commentedon May 8, 2018
Note: now we have Angular Elements, support for ES2015 becomes more important, because transpiling custom elements to ES5 is not supported by the standard and produces an error.
rafaelfgx commentedon May 10, 2018
With all the respect, this is a very basic bug and one that should be avoided.
You create an Angular 6 application, without changing anything, with all the default settings, build it for production, and it does not work.
It is very serious that something so trivial as publishing in production is not working in the final version.
More testing is needed, especially for the most important and essential tasks.
robwormald commentedon May 11, 2018
@rafaelfgx - nobody should be using es2015 modules in production, Webpack doesn’t export them, and they’re not turned on by default.
msklvsk commentedon May 11, 2018
While buildOptimizer is turned on by default, es6 is not, including the docs:
(angular.io/guide/typescript-configuration)
devoto13 commentedon May 14, 2018
@hansl It does not seem to be the case.
Here is ES2015 with build optimizer on (fails with angular/angular-cli#10658):
Here is ES2015 with build optimizer off:
As you can see it is ~200k less with build optimizer enabled. Not sure if it is real gain or a side effect of build optimizer removing not dead code, but this looks like a lot of gain. Most of it comes from Angular packages (~180k).
found the problem with ngBuild:
found the problem with ngBuild:
catull commentedon May 16, 2018
Hmm, I see a build optimiser bug for production builds with ES5.
See angular/angular-cli#7799 (comment).
That issue is closed, stating that the bug is tracked here.
As a work-around, I switched off build-optimiser and the app is working.
With build-optimiser ON, the error is as documented in the "issue comment" at the top of this comment.
hijamoya commentedon May 17, 2018
I got same issues here.
byrondover commentedon May 27, 2018
@robwormald You may want to align with @StephenFluin on your community messaging around enabling ES2015. 😅
https://twitter.com/stephenfluin/status/997224523610116096
P.S. Big fans of all the work you do and are doing! 🤞for production ES2015 support by 2020.
robwormald commentedon May 27, 2018
@byrondover ES2015 syntax (classes, const,let,etc) is fine (assuming your browser target supports it) - lots of good wins to be had there.
ES2015 modules, not so much (though if you a very adventurous, no harm trying)
16 remaining items
Maximaximum commentedon May 31, 2018
cedvdb commentedon Jun 5, 2018
issue still here with 0.7.0 and target es6.
What would be really nice is an error at compilation time as to maybe find a temporary fix for the part of the code that's problematic.
filipesilva commentedon Jun 5, 2018
@cedvdb can you put up a repro I can look at please?
feat(@angular-devkit/build-optimizer): remove angular es5 whitelist
fix(@angular-devkit/build-optimizer): don't search for pure top-level…
fix(@angular-devkit/build-optimizer): don't search for pure top-level…
fix(@angular-devkit/build-optimizer): don't search for pure top-level…
fix(@angular-devkit/build-optimizer): don't search for pure top-level…
fix(@angular-devkit/build-optimizer): don't search for pure top-level…
fix(@angular-devkit/build-optimizer): don't search for pure top-level…
cedvdb commentedon Jun 6, 2018
@filipesilva
The problem seems to be resolved. I didn't manage to reproduce it yet. If you need so I could dig deeper this evening, right now I gotta work.
filipesilva commentedon Jun 6, 2018
As long as it's working, I think there's no need to look further. If I had to bet it wasn't working because at some point you were in an old version.
This fix is only on
@angular-devkit/build-optimizer@0.7.0-beta.1that comes with@angular-devkit/build-angular@0.7.0-beta.1.You can check what version you have with
npm list @angular-devkit/build-optimizer.shahafal commentedon Jun 6, 2018
thank you for this, it's the first time i'm hearing of it. unfortunately except for discussions about this being an issue i can't find anywhere a discussion about the status to fix this.
do you know if there is an open thread in github (or someplace else) discussing the fix? i would like to follow it
alexeagle commentedon Sep 4, 2018
This issue was moved to angular/angular-cli#12112