Skip to content

Commit 6457d8a

Browse files
authored
fix: improve build speed with vite (#304)
* fix: improve build speed with vite * fix: bug issue
1 parent 17c823b commit 6457d8a

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

packages/devtools-vite/src/plugin.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,19 @@ export const devtools = (args?: TanStackDevtoolsViteConfig): Array<Plugin> => {
202202
},
203203
enforce: 'pre',
204204
transform(code, id) {
205-
if (id.includes('node_modules') || id.includes('?raw')) return
205+
const devtoolPackages = [
206+
'@tanstack/react-devtools',
207+
'@tanstack/preact-devtools',
208+
'@tanstack/solid-devtools',
209+
'@tanstack/vue-devtools',
210+
'@tanstack/devtools',
211+
]
212+
if (
213+
id.includes('node_modules') ||
214+
id.includes('?raw') ||
215+
!devtoolPackages.some((pkg) => code.includes(pkg))
216+
)
217+
return
206218
const transform = removeDevtools(code, id)
207219
if (!transform) return
208220
if (logging) {

0 commit comments

Comments
 (0)