@dragonmastery/daisypress-theme
v0.1.10
Published
A custom VitePress theme for DaisyUI and DaisyBlocks
Readme
@dragonmastery/daisypress-theme
A custom VitePress theme for DaisyUI 5 and DaisyBlocks.
Setup
- Install the theme and its peer dependencies.
- Required: Extend the base config so the theme builds correctly.
Option A: extends (recommended)
// .vitepress/config.ts
import { defineConfig } from 'vitepress'
import daisypressBaseConfig, {
createBlogNav,
createBlogTransformPageData,
createChainedTransform,
genFeed,
} from '@dragonmastery/daisypress-theme/config'
export default defineConfig({
extends: daisypressBaseConfig,
vite: {
plugins: [tailwindcss()],
server: { port: 5777 },
},
themeConfig: {
nav: [createBlogNav({ ... })],
},
transformPageData: createChainedTransform([...]),
buildEnd: async (config) => {
await genFeed(config, { ... })
},
})Option B: Spread into vite
import { daisypressViteConfig, ... } from '@dragonmastery/daisypress-theme/config'
export default defineConfig({
vite: {
...daisypressViteConfig,
plugins: [tailwindcss()],
},
// ...
})Why this is required
The theme uses VitePress client APIs (useData, useRoute, withBase). When consumed as a published package, the theme must be bundled by Vite during SSR instead of being loaded externally. The config sets ssr.noExternal: ['@dragonmastery/daisypress-theme'].
Without this, builds can fail with Cannot find module '.../vitepress/dist/client/app/data' in standalone projects.
