Global Configuration

tps.json is the per-project configuration file for a Transpose project. It sits in the project root, next to the .csproj, and controls where output goes, what the generated index.html contains, whether reflection metadata is emitted, and which static assets are bundled.

tps.json is optional — with no file at all the compiler uses its defaults and the build still runs.

Basic structure

A minimal tps.json:

tps.json
{
  "output": "$(OutDir)tps/",
  "fileName": "app.js"
}

The file is JSON with // and /* */ comments and trailing commas allowed (JSONC). Property names are camelCase.

Configuration options

The options below are the complete set the compiler reads. Anything else in the file is ignored.

output

Type: string · Default: $(OutDir)tps/

The output directory for the generated site (or, for a library, the folder the compiled JavaScript is written to before it is embedded). Relative paths are resolved against the project directory, and the MSBuild token $(OutDir) is substituted.

{
  "output": "$(OutDir)tps/"
}

fileName

Type: string · Default: app.js

The name of the emitted JavaScript bundle. A library with no explicit fileName emits <AssemblyName>.js.

{
  "fileName": "app.js"
}

The reflection metadata file is named after it — app.js produces app.meta.js.

outputFormatting

Type: string · Default: Both

Which variants of the JavaScript to produce.

Value Produces
Formatted The readable .js only
Minified The minified .min.js only
Both Both variants (the default)

Which variant the generated HTML references depends on the build configuration — see Build Configurations.

html

Type: object

Controls the generated index.html.

{
  "html": {
    "disabled": false,
    "title": "My Transpose App",
    "head": "<link rel=\"icon\" href=\"favicon.ico\">",
    "body": "<div id=\"root\"></div>",
    "meta": "<meta name=\"theme-color\" content=\"#5495f1\">"
  }
}
Key Type Description
disabled bool true skips HTML generation entirely (use this for a library).
title string The <title> of the page. Defaults to the assembly name.
head string Raw markup injected into <head>.
body string Raw markup injected into <body>, before the script tags.
meta string Raw <meta> markup injected into <head>.

reflection

Type: object

Controls the reflection metadata Transpose emits so runtime type inspection works. See Reflection.

{
  "reflection": {
    "disabled": false,
    "target": "file"
  }
}
Key Type Description
disabled bool true emits no reflection metadata at all, which shrinks the bundle.
target string file (default) writes a separate <fileName>.meta.js; inline puts the metadata in the main bundle.

resources

Type: array

Bundles static assets (JavaScript, CSS, fonts, images) into the output, embeds them into a library's package DLL, and links them from the generated index.html.

{
  "resources": [
    { "name": "app.css", "files": [ "assets/css/app.css" ] }
  ]
}

This section has its own page covering every key, how files are combined, glob support, and the load flag — see Resources.

cleanOutputFolder

Type: boolean · Default: true

After a successful build, prune the output folder: any file left over from a previous build that this build did not (re)write is deleted, and directories left empty are removed. Nothing the current build wrote is ever touched, and a build that fails leaves the previous output intact.

This is what removes a bundle you renamed, a .min.js variant a Formatted build no longer emits, a deleted resource, or a stale index.min.html.

{
  "cleanOutputFolder": true
}

Set it to false to let files accumulate.

cleanOutputFolderExclude

Type: string[]

Glob patterns (* and ? wildcards, matched against each file's output-relative path and against its file name) that cleanOutputFolder never prunes, even when stale. This is the escape hatch for hand-placed files that live alongside the generated site.

{
  "cleanOutputFolder": true,
  "cleanOutputFolderExclude": [ "favicon.ico", ".htaccess", "vendor/*" ]
}

Only files the build did not write are ever tested against these patterns.

outputBy

Type: string

The file-layout mode for the emitted JavaScript. ClassPath — one file per class, laid out by namespace path — is used to build the tps.js runtime itself. Every other mode currently emits a single bundle, so this setting is not useful in an application project yet.

Per-configuration files

Alongside tps.json you can ship tps.Debug.json, tps.Release.json, or a file named after any custom configuration. The matching file is merged over the base tps.json for that build. See Build Configurations for the merge rules.

Options that are not supported

If you are porting from h5, the following h5.json settings have no Transpose equivalent and are ignored when present:

h5 setting Status in Transpose
sourceMap Source maps are not emitted yet.
module Module formats (AMD / CommonJS / ES6 / UMD) are not implemented; output is a global-scope bundle. See Output Types.
locales Not implemented.
beforeBuild / afterBuild Not implemented. Use MSBuild targets in the .csproj instead.
rules Not implemented.
pluginsPath Compiler plugins are not supported.
generateTypeScript TypeScript declarations are not emitted.
generateDocumentation JSDoc comments are not emitted.
cleanOutputFolderBeforeBuild / …Pattern Replaced by cleanOutputFolder (above), which prunes after a successful build by diffing what the build produced.

See Migrating from h5 for the full porting guide.

© 2026 Curiosity. All rights reserved.