We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a5448af commit b5d8124Copy full SHA for b5d8124
1 file changed
packages/devtools-vite/src/plugin.ts
@@ -178,8 +178,14 @@ export const devtools = (args?: TanStackDevtoolsViteConfig): Array<Plugin> => {
178
},
179
{
180
name: '@tanstack/devtools:remove-devtools-on-build',
181
- apply(_, { command }) {
182
- return command === 'build' && removeDevtoolsOnBuild
+ apply(config, { command }) {
+ // Check both command and mode to support various hosting providers
183
+ // Some providers (Cloudflare, Netlify, Heroku) might not use 'build' command
184
+ // but will always set mode to 'production' for production builds
185
+ return (
186
+ (command !== 'serve' || config.mode === 'production') &&
187
+ removeDevtoolsOnBuild
188
+ )
189
190
enforce: 'pre',
191
transform(code, id) {
0 commit comments