Skip to content

Angular: Esbuild always generates chunks for devtools #9078

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
arnoud-dv opened this issue Apr 28, 2025 · 0 comments
Open

Angular: Esbuild always generates chunks for devtools #9078

arnoud-dv opened this issue Apr 28, 2025 · 0 comments

Comments

@arnoud-dv
Copy link
Collaborator

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 from app.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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant