0.2.5 • Published 9 months ago
@content-collections/vite v0.2.5
title: Vite Integration
Install required packages:
We have to install the following packages:
@content-collections/core@content-collections/vite
pnpm add -D @content-collections/core @content-collections/viteAdjust your
tsconfig.json:{ "compilerOptions": { // ... "paths": { "content-collections": ["./.content-collections/generated"] } } }We require a path alias for the generated files. This is necessary because we will generate the files in the
.content-collections/generatedfolder.Modify your
vite.config.ts:import { defineConfig } from "vite"; import contentCollections from "@content-collections/vite"; export default defineConfig({ plugins: [/** other plugins */, contentCollections()], });Add the Content Collections plugin to your Vite config.