---
title: createThemeVirtualModuleSource
description: 'Generates the `virtual:svartz/theme` module source.'
updated_at: '2026-10-27T20:25:56+01:00'
created_at: '2026-03-07T03:07:52+01:00'
symbol:
  kind: function
  name: createThemeVirtualModuleSource
  signatures:
    - >-
      createThemeVirtualModuleSource(themeImport:
      [[reference/api/vite/ThemeImport|ThemeImport]], themeConfig?:
      Record<string, unknown>): string
  parameters:
    - name: themeImport
      type: '[[reference/api/vite/ThemeImport|ThemeImport]]'
    - name: themeConfig
      type: 'Record<string, unknown>'
      optional: true
  returns:
    type: string
  source: >-
    https://github.com/mia-cx/svartz/blob/711f3906a713c8b9a5a572d0f34c85e90c3bc3d1/packages/vite/src/theme-resolver.ts#L277
---

# createThemeVirtualModuleSource

If the theme module exports a factory function, it is called with themeConfig
at module evaluation time so route patterns reflect vault-level configuration.
Several theme modules compose their `extensions` on theme-minimal's shell.
