Config & plugins

Configuration

Full technical specification for manic.config.ts with TypeTable definitions.

Configuration Reference

TL;DR

Complete reference for manic.config.ts - covers all configuration options with full TypeScript type definitions.

The manic.config.ts file (or .js) is the source of truth for your application's build and runtime behavior. Use the defineConfig helper to ensure full type safety.


Config helpers

import { defineConfig } from 'manicjs/config';

export default defineConfig({
  mode: 'fullstack',
  app: {
    name: 'My Manic App',
  },
  server: {
    port: 6070,
  },
});

Top-Level Options

Prop

Type


app Settings

Prop

Type

server Settings

Prop

Type

router Settings

Prop

Type

build Settings

Prop

Type


Sitemap Configuration

Manic can automatically generate a sitemap.xml for your application:

import { defineConfig } from 'manicjs/config';

export default defineConfig({
  sitemap: {
    hostname: 'https://example.com',
    exclude: ['/admin/**'],
    changefreq: 'daily',
    priority: 0.7,
  },
});

Sitemap Options

Prop

Type


OXC Configuration

Customize the OXC transformer for advanced optimization:

import { defineConfig } from 'manicjs/config';

export default defineConfig({
  oxc: {
    target: 'es2022',
    minify: true,
    mangle: true,
  },
});

Plugins & Providers

Using Plugins

import { defineConfig } from 'manicjs/config';
import { tailwind } from '@manicjs/tailwind';
import { mdx } from '@manicjs/mdx';

export default defineConfig({
  plugins: [
    tailwind(),
    mdx({
      frontmatter: true,
      gfm: true,
    }),
  ],
});

Using Providers

import { defineConfig } from 'manicjs/config';
import { vercel } from '@manicjs/providers';
import { cloudflare } from '@manicjs/providers';

export default defineConfig({
  providers: [
    vercel({
      regions: ['sfo1', 'iad1'],
    }),
    cloudflare(),
  ],
});

Environment variables

manic.config.ts does not declare runtime env vars. Use .env / .env.local files and read values with getEnv from manicjs/env (client: MANIC_PUBLIC_* only) or process.env on the server.

See Environment variables.


Full Example

import { defineConfig } from 'manicjs/config';
import { vercel } from '@manicjs/providers';
import { tailwind } from '@manicjs/tailwind';

export default defineConfig({
  mode: 'fullstack',

  app: {
    name: 'My Manic App',
  },

  server: {
    port: 6070,
    hmr: true,
  },

  router: {
    viewTransitions: true,
    preserveScroll: false,
    scrollBehavior: 'smooth',
  },

  build: {
    outdir: '.manic',
    minify: true,
    splitting: true,
    sourcemap: 'inline',
  },

  sitemap: {
    hostname: 'https://example.com',
    exclude: ['/admin/**'],
    changefreq: 'weekly',
    priority: 0.7,
  },

  oxc: {
    target: 'es2022',
  },

  plugins: [tailwind()],

  providers: [vercel()],
});

See also:

On this page