Skip to content

Options ​

optiondefault
viewsDir'src/views'
rootsnonenamed view roots, { billing: '/abs/path' } — absolute folders; the Vite plugin fills them in from kick.config (view roots)
componentsDir'components'inside viewsDir
pipesFile'src/views/pipes.ts'.js also works; without Vite, Node runs a .ts file only when it can strip types (22.18+)
validatorsFile'<viewsDir>/validators.ts'your own validators; read when there is no build
layoutnonea layout name, or folder prefix → layout
baseLayoutnonethe shell around every page's outermost layout
locale'en-US'
timeZone'UTC'
strictfalseunknown names and values that can't print become errors
sharenone(ctx) => data
assetsnone(entry, data) => tags, for @assets
cachetruefalse re-reads every template on every render
devNODE_ENV === 'development', or no bundle (kick dev), with KickViewre-check changed templates on each render
bundle, pipes, clientScriptPath, clientDirfrom virtual:kick-viewspass them all with ...kickViews; without clientDir, files the build wrote to disk aren't served
loaderthe file loader{ list, read, version? } for templates from anywhere else

The Vite plugin's own options, in vite.config.ts as kickjs({ views: { … } }):

optiondefault
viewsDir'src/views'
componentsDir'components'
pipesFile'<viewsDir>/pipes.ts'
validatorsFile'<viewsDir>/validators.ts'your own validators
clientScriptPath'/_kick/c'the URL path client files are served under
clientFiles'disk''bundle' keeps client files in the server bundle
publicDir'public'relative to the build's outDir, or absolute; files go to <publicDir><clientScriptPath>/
inlineLimit4096images and fonts up to this many bytes are inlined ('disk' only)

Released under the MIT License. Built with TypeScript — runs on Express, Fastify, or h3.