Setting Up cside

Vite Integration

Integrate cside with your Vite application using the @cside.dev/vite plugin.

Installation

Install the cside Vite plugin:

npm i @cside.dev/vite

Setup

Add the cside plugin to your vite.config.js or vite.config.ts:

// vite.config.ts
import { defineConfig } from "vite";
import cside from "@cside.dev/vite";

export default defineConfig({
	plugins: [
		cside({
			domain: "your-domain.com",
		}),
	],
});

Replace your-domain.com

Replace your-domain.com with your actual domain configured in cside.

Configuration Options

The plugin accepts the following configuration options:

  • domain (required) - Your domain configured in the cside dashboard
  • excludedScripts (optional) - Array of script URLs to exclude from prefixing

Example with all options:

// vite.config.ts
import { defineConfig } from "vite";
import cside from "@cside.dev/vite";

export default defineConfig({
	plugins: [
		cside({
			domain: "your-domain.com",
			excludedScripts: ["https://example.com/skip.js"],
		}),
	],
});

Server-side prefixing

The Vite plugin automatically handles server-side prefixing during the build process, ensuring optimal performance and Firefox compatibility.

How is this doc?

On this page