mirror of
https://github.com/TanStack/devtools.git
synced 2026-11-16 10:49:48 +00:00
* fix(devtools-vite): inject data-tsd-source before other plugins transform inject-source uses `enforce: 'pre'`, so a `pre` plugin listed before devtools() transformed the code first. When that plugin changes the code of one environment only (a server-function compiler, for example), the lines shift, and data-tsd-source differs between the SSR and client output. React then reports a hydration mismatch, for example `editor.tsx:632:5` on the server and `editor.tsx:636:5` on the client. The transform hook now has `order: 'pre'`, so it runs before the other plugins' transform hooks, whatever their position in the array. Fixes #405 Fixes #189 * docs(devtools-vite): note that an earlier order: 'pre' transform still runs first |
History
|
|
|---|---|---|
| .. | ||
| bin | ||
| skills/devtools-vite-plugin | ||
| src | ||
| tests | ||
| CHANGELOG.md | ||
| eslint.config.js | ||
| package.json | ||
| README.md | ||
| tsconfig.docs.json | ||
| tsconfig.json | ||
| vite.config.ts | ||
@tanstack/devtools-vite
This package is still under active development and might have breaking changes in the future. Please use it with caution.
General Usage
The @tanstack/devtools-vite package is designed to work with Vite projects.
Plug it into your plugins array:
import { devtools } from '@tanstack/devtools-vite'
export default {
plugins: [
// Important to include it first!
devtools(),
... //rest of the plugins
],
}