Vite plugin to inject react-grab script
npm install vite-plugin-react-grabVite plugin to inject react-grab script into HTML (development only).
``bash`
npm install vite-plugin-react-grab -D
`typescript
// vite.config.ts
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { pluginReactGrab } from "vite-plugin-react-grab";
export default defineConfig({
plugins: [
react(),
pluginReactGrab({
version: "0.0.88", // optional, default: '0.0.88'
append: false, // optional, default: false (inject to head)
}),
],
});
`
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| version | string | '0.0.88' | react-grab version |append
| | boolean | false | If true, append to body; if false, inject to head |
This plugin only injects the script in development mode (vite dev`). Production builds will not include the react-grab script.
MIT