Skip to main content

Runtime - Edge

Add the DOM-compatible type definitions and bundler module resolution that edge runtimes expect, layered on top of the Nova baseline and strict presets.

Why Use This Preset?

  1. Loads the DOM and DOM.Iterable libs so the Web-standard globals edge runtimes expose type-check without manual wiring.
  2. Sets moduleResolution to Bundler so imports resolve the way a bundler resolves them rather than the way Node does.
  3. Uses ESNext modules so the platform's bundler controls the final output format instead of TypeScript downleveling it.
  4. Drops in as the environment layer after the essentials and strict presets so you only declare where the code runs.

Usage

Add the preset as the last entry in the extends array of your tsconfig.json, after the essentials and strict layers.

tsconfig.json
json
{
  "extends": [
    "@cbnventures/nova/presets/tsconfig/dx-essentials.json",
    "@cbnventures/nova/presets/tsconfig/dx-strict.json",
    "@cbnventures/nova/presets/tsconfig/runtime-edge.json"
  ]
}

What This Preset Configures

The preset sets the following compilerOptions, overriding the matching values from the layers below it.

SettingValueDescription
libDOM, DOM.Iterable, ESNextLoads DOM globals, DOM iterable types, and the latest JavaScript types.
moduleESNextEmits modern ESM and leaves the final format to your bundler.
moduleResolutionBundlerResolves imports the way a bundler does, matched to the module setting.

info

The lib array replaces the parent value rather than merging with it, so this preset restates ESNext alongside the DOM libs.