import { Plugin } from 'vite'; /** * SvelteKit dev bypasses Vite's `transformIndexHtml`, so `@vitejs/devtools`'s * `DevToolsInjection` never reaches the served HTML and the dock is invisible * on every SvelteKit page. Tracked upstream at * https://github.com/baseballyama/vite-devtools-repl/tree/main/sveltekit-transform-index-html-bypass * * As a stopgap, SvelteKit inlines `src/app.html` as a JS string literal inside * `.svelte-kit/generated/server/internal.js`: * * templates: { * app: ({ head, body, ... }) => ".........", * } * * That file is loaded through Vite's module pipeline (`vite.ssrLoadModule`), * so a regular `transform` hook can rewrite the literal to insert the dock's * inject script before ``. The actual `