import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { editorApiPlugin } from './vite-plugin-editor-api.js'

// https://vite.dev/config/
// editorApiPlugin alleen actief in dev mode voor de Markdown editor
export default defineConfig(({ command }) => ({
  plugins: [
    react(),
    command === 'serve' ? editorApiPlugin() : null,
  ].filter(Boolean),
  base: '/',
}))
