@cside.dev/vite
v2.0.0
Published
Vite plugin for integrating cside
Downloads
6,396
Readme
@cside.dev/vite
Integrate cside into your Vite project with ease.
Installation
# npm
npm i -D @cside.dev/vite
# yarn
yarn add -D @cside.dev/vite
# pnpm
pnpm i -D @cside.dev/viteUsage
Add the plugin to your vite.config.ts:
import { defineConfig } from "vite";
import { cside } from "@cside.dev/vite";
export default defineConfig({
plugins: [
cside({
teamId: "your-team-id",
}),
],
});That's it. The plugin injects the cside script into your built index.html.
Options
| Option | Type | Default | Description |
| --------- | --------- | ------------------------------- | ------------------------------------------------------------------------------------------ |
| teamId | string | — | Your cside team ID. Loads the script from https://{teamId}.csidetm.com/script.js. |
| enabled | boolean | true in build, false in dev | Force-enable or disable the plugin. By default it auto-disables during vite dev. |
cside({
teamId: "your-team-id",
enabled: true,
});If
teamIdis not provided, the plugin falls back to the default proxy script athttps://proxy.csidetm.com/script.js.The previous
scriptUrlandproxyUrloptions are deprecated — useteamIdinstead.
How it works
During the transformIndexHtml step, the plugin prepends a <script> tag loading the cside script to <head>.
Documentation
See the cside docs for more.
