Skip to content

Conversation

@morinokami
Copy link

@morinokami morinokami commented Dec 5, 2025

Add @tanstack/devtools-vite to automatically remove devtools from the production build.

related: bun-templates/bun-tanstack-start#1

Comment on lines -51 to +59
{isDevelopment && (
<TanStackDevtools
config={{
position: "bottom-right",
}}
plugins={[
{
name: "Tanstack Router",
render: <TanStackRouterDevtoolsPanel />,
},
]}
/>
)}
<TanStackDevtools
config={{
position: "bottom-right",
}}
plugins={[
{
name: "Tanstack Router",
render: <TanStackRouterDevtoolsPanel />,
},
]}
/>
Copy link
Author

@morinokami morinokami Dec 5, 2025

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.

image

https://tanstack.com/devtools/latest/docs/production#vite-plugin-configuration


const config = defineConfig({
plugins: [
devtools(),
Copy link
Author

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.

https://tanstack.com/devtools/latest/docs/quick-start

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant