Skip to main content

Framework - Svelte

Configure TypeScript for Svelte components and a bundler-owned build.

Usage

tsconfig.json
json
{
  "extends": [
    "@cbnventures/nova/presets/tsconfig/dx-essentials.json",
    "@cbnventures/nova/presets/tsconfig/dx-strict.json",
    "@cbnventures/nova/presets/tsconfig/runtime-browser.json",
    "@cbnventures/nova/presets/tsconfig/fw-svelte.json"
  ],
  "include": [
    "./src/**/*"
  ]
}

Compiler Options

OptionValuePurpose
allowJstrueAllows JavaScript emitted by Svelte tooling to participate.
checkJstrueType-checks the allowed JavaScript instead of accepting it loose.
isolatedModulestrueKeeps every file safe for independent bundler transforms.
lib["DOM", "DOM.Iterable", "ESNext"]Provides browser and modern JavaScript APIs.
module"ESNext"Preserves ECMAScript modules for the bundler.
moduleResolution"Bundler"Resolves package exports the way a modern bundler does.
noEmittrueKeeps TypeScript as the checker while the bundler owns output.