-
Notifications
You must be signed in to change notification settings - Fork 2
feat: add devtools to vite config #1
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
base: main
Are you sure you want to change the base?
Conversation
| {isDevelopment && ( | ||
| <TanStackDevtools | ||
| config={{ | ||
| position: "bottom-right", | ||
| }} | ||
| plugins={[ | ||
| { | ||
| name: "Tanstack Router", | ||
| render: <TanStackRouterDevtoolsPanel />, | ||
| }, | ||
| ]} | ||
| /> | ||
| )} | ||
| <TanStackDevtools | ||
| config={{ | ||
| position: "bottom-right", | ||
| }} | ||
| plugins={[ | ||
| { | ||
| name: "Tanstack Router", | ||
| render: <TanStackRouterDevtoolsPanel />, | ||
| }, | ||
| ]} | ||
| /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Vite plugin removes all devtools related code from the production build, so we don't have to manually exclude the devtools here.
https://tanstack.com/devtools/latest/docs/production#vite-plugin-configuration
|
|
||
| const config = defineConfig({ | ||
| plugins: [ | ||
| devtools(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Vite plugin must be placed as the first plugin in the plugins array.
Add
@tanstack/devtools-viteto automatically remove devtools from the production build.related: bun-templates/bun-tanstack-start#1