@croco/frontend-vite
v0.0.2
Published
> Croco Presentation Tier — 5th layer: Framework → Protocols → Transports → Integrations → Presentation
Readme
@croco/frontend-vite
Croco Presentation Tier — 5th layer: Framework → Protocols → Transports → Integrations → Presentation
Cloudflare Workers + Vite + Vike 통합 플러그인 패키지입니다.
이 패키지는 Cloudflare Workers 환경에서 Vite와 Vike를 함께 사용하기 위한 플러그인을 제공합니다.
설치
pnpm add @croco/frontend-vite사용법
Vite 설정
vite.config.ts에서 플러그인을 설정합니다:
import { crocoVitePlugin } from "@croco/frontend-vite";
export default {
plugins: crocoVitePlugin(),
};옵션
import { crocoVitePlugin } from "@croco/frontend-vite";
export default {
plugins: crocoVitePlugin({
ssr: true,
cloudflare: true,
}),
};API
crocoVitePlugin(options?)
Cloudflare Workers + Vite + Vike 통합 플러그인을 반환합니다.
옵션:
ssr?: boolean- SSR 활성화 여부 (기본값:true)cloudflare?: boolean- Cloudflare Workers 타겟 여부 (기본값:true)
반환값: Plugin[] - Vite 플러그인 배열
타입
CrocoViteOptions
플러그인 옵션 타입입니다.
export type CrocoViteOptions = {
ssr?: boolean;
cloudflare?: boolean;
};CrocoViteConfig
플러그인 설정 타입입니다.
export type CrocoViteConfig = {
plugins: Plugin[];
};예제
기본 설정
import { defineConfig } from "vite";
import { crocoVitePlugin } from "@croco/frontend-vite";
export default defineConfig({
plugins: crocoVitePlugin(),
});SSR 비활성화
import { defineConfig } from "vite";
import { crocoVitePlugin } from "@croco/frontend-vite";
export default defineConfig({
plugins: crocoVitePlugin({ ssr: false }),
});Cloudflare 비활성화
import { defineConfig } from "vite";
import { crocoVitePlugin } from "@croco/frontend-vite";
export default defineConfig({
plugins: crocoVitePlugin({ cloudflare: false }),
});라이선스
MIT
