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?
- Loads the
DOMandDOM.Iterablelibs so the Web-standard globals edge runtimes expose type-check without manual wiring. - Sets
moduleResolutiontoBundlerso imports resolve the way a bundler resolves them rather than the way Node does. - Uses
ESNextmodules so the platform's bundler controls the final output format instead of TypeScript downleveling it. - 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
{
"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.
| Setting | Value | Description |
|---|---|---|
lib | DOM, DOM.Iterable, ESNext | Loads DOM globals, DOM iterable types, and the latest JavaScript types. |
module | ESNext | Emits modern ESM and leaves the final format to your bundler. |
moduleResolution | Bundler | Resolves 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.
Related
- Review the layering order in TSConfig Best Practices.
- See how presets compose end to end in the Presets Overview.