BuildOptimizer breaks 3rd party library
See original GitHub issueFrom @Enngage on May 18, 2018 8:17
Bug Report or Feature Request (mark with an x
)
- [x ] bug report -> please search issues before submitting
- [ ] feature request
Area
- [x] devkit
- [ ] schematics
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
Copied from original issue: angular/devkit#937
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
@angular-devkit/build-optimizer | Yarn - Package Manager
This package has been folded in @angular-devkit/build-angular and should no longer be needed. This package has always been experimental and never hit 1.0.0, ......
Read more >Angular vs. React: Which Is Better for Web Development?
Basically, all components we want to use in the application need to go to declarations. All third-party libraries to imports, and all global...
Read more >Angular build for production fails - Stack Overflow
When I try to build for production my angular application with the following command ng build --prod --build-optimizer I get the following ...
Read more >Ahead-of-time (AOT) compilation - Angular
Fewer asynchronous requests, The compiler inlines external HTML templates ... Ahead-of-Time (AOT), Compiles your application and libraries at build time.
Read more >The Best Way To Architect Your Angular Libraries
How to create Angular library implementing clean architecture ... Sometimes our library uses some other 3rd party libraries like date-fns .
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I guess this is the same problem with pure_getters: true that is discussed in issue 11439, too.
From @Enngage on May 26, 2018 7:58
Forgive my ignorance, but I wasn’t able to find exactly what the
pure_getters
actually mean in real world. How would you identify such ‘invalid’ pure getter?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.