-
Notifications
You must be signed in to change notification settings - Fork 156
BuildOptimizer breaks 3rd party library #937
Comments
This seems like a bug but we'll need to look at a reproduction to find and fix the problem. Can you setup a minimal repro please? You can read here why this is needed. A good way to make a minimal repro is to create a new app via |
Thanks for the response! Sure, I understand - this is the minimal code I could come up with (repo generated with To reproduce:
You should see new image appear with no animation each second. When you use either Let me know if you need anything else. |
This is not actually due to the build optimizer itself but rather a minification setting that is enabled when the build optimizer is enabled. Specifically the |
Forgive my ignorance, but I wasn't able to find exactly what the Isn't there a possibility of excluding libraries from the build optimizer? I think it might make sense for you to be able to specify if some library should be skipped so that you can still leverage build optimizer for the rest of your code. |
This issue was moved to angular/angular-cli#12096 |
Bug Report or Feature Request (mark with an
x
)Area
Versions
npm 5.6.0
node v8.9.4
Windows (10
Repro steps
I have this simple angular library repo where I use masonry js library. Everything works perfectly fine (demo) as long as
buildOptimizer
is disabled:"buildOptimizer": false
However, as soon as I enable it, some animations (not all!) are broken. I'm pretty confident this is not the issue in the masonry js library, rather it seems like build optimizer might be tampering with the code in some way.
Is there a way to 'disable' build optimizer for this library only? Or could this be part of a bigger problem somewhere?
The log given by the failure
No errors/warnings logged anywhere.
Desired functionality
Don't break code of external libraries.
Mention any other details that might be useful
Angular.json
The text was updated successfully, but these errors were encountered: