Description
Describe the bug
The Angular Query devtools are lazy loaded to optimize startup performance of the app while developing and to minimize bundle sizes.
However, even if the code that performs the lazy load is tree shaken, esbuild wil generate unnessary chunks adding to application deployment size.
Your minimal, reproducible example
https://tanstack.com/query/latest/docs/framework/angular/examples/basic
Steps to reproduce
- Go to the linked Stackblitz
- Remove
withDevtools
fromapp.config.ts
- Open the terminal and run
npm run build
- The Angular CLI will now perform an optimized production build
- Note several lazy chunk files are generated even though there is no reference to
withDevtools
in the application
Expected behavior
No chunks should be generated for devtools if they are not used
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
N/a
Tanstack Query adapter
angular-query
TanStack Query version
v5.74.7
TypeScript version
No response
Additional context
PR in progress