Skip to content

mockkit.json

mockkit.json is the MockKit configuration file for a project. It must exist in the project root directory.

The JSON structure is as follows.

ts
type ManifestJson = {
  name: string
  settings: {
    path: {
      normalizeTrailingSlash: 'append' | 'remove' | 'preserve'
    }
  }
  build: {
    engine: 'manual' | 'nuxt'
    distDir: string
    publicDir: string
    devPort: number
    devCommand: string
    generateCommand: string
  }
  sitemap: SiteMapItem[]
}

type SiteMapItem = GroupItem | PageItem

type GroupItem = {
  type: 'group'
  name: string
  content: SiteMapItem[]
}

type PageItem = {
  type: 'page'
  name: string
  path: string
}

The meaning of each field is as follows.

FieldDescriptionExample
nameSite name'My First Project'
settings.path.normalizeTrailingSlashHow to normalize trailing slashes in URLs: 'append', 'remove', or 'preserve''append'
build.engineStatic site generator type: 'manual' or 'nuxt''manual'
build.distDirBuild output directory'dist'
build.publicDirBuild output public directory'public'
build.devPortDevelopment server port3000
build.devCommandDevelopment server start command'npm run dev'
build.generateCommandStatic site generation command'npm run generate'
sitemapSitemap contents (described below)[]