0.1.0 • Published 2 months ago

vite-plugin-decap-cms v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

vite-plugin-decap-cms

A Vite plugin to connect Decap CMS

NPM Version NPM Downloads GitHub Issues or Pull Requests

!DANGER Unstable version This plugin has not reached a stable version, 1.0.0, and can include breaking changes following the semver specification. This plugin is open for contributions, both for code, suggestions and (missing) documentation.

Install

pnpm add vite-plugin-decap-cms -D
npm install vite-plugin-decap-cms -D
yarn add vite-plugin-decap-cms -D

Usage

// vite.config.ts
import { defineConfig } from 'vite'
import decap, {
    createFolderCollection,
    createField,
} from 'vite-plugin-decap-cms'

export default defineConfig({
    publicDir: 'public',
    plugins: [
        decap({
            config: {
                backend: {
                    name: 'test-repo',
                },
                mediaFolder: '/src/public/',
                collections: [
                    createFolderCollection({
                        name: 'test',
                        label: 'Test collection',
                        folder: 'test',
                        fields: [
                            createField('markdown', { name: 'body' }),
                        ],
                    }),
                ]
            }
        })
    ],
})

Example

See the documentation for an example

Development

npm run docs:dev
npm run cms:dev

License

MIT

0.1.0

2 months ago