question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BuildOptimizer breaks 3rd party library

See original GitHub issue

From @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

Angular.json

Copied from original issue: angular/devkit#937

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
michaelbaurcommented, Sep 5, 2018

I guess this is the same problem with pure_getters: true that is discussed in issue 11439, too.

1reaction
alexeaglecommented, Sep 4, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found