Skip to main content

Framework - React

Configure TypeScript for a bundler-built React application.

Usage

Add fw-react after Nova's required essentials and strict layers and the browser runtime.

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-react.json"
  ],
  "include": [
    "./src/**/*"
  ]
}

Compiler Options

OptionValuePurpose
isolatedModulestrueKeeps every file safe for independent bundler transforms.
jsx"react-jsx"Uses React's modern automatic JSX runtime.
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.