Configuration
Compiler, Vite and TypeScript options for a ShadowJS app, with defaults and the effect of each setting.
Four layers configure a ShadowJS app. Each section below lists every option, its default and what it does, and most options are proven by a program that runs the real code.
| Layer | Where | Section |
|---|---|---|
| The JSX compiler | compile(source, options) from @shadow-js/compiler |
Compiler options |
| The Vite plugin | shadow(options) in vite.config.ts |
Vite plugin |
| TypeScript | tsconfig.json |
TypeScript |
| Vitest | vitest.config.ts |
Vitest |
| Build constants | isDev, isServer, export conditions |
Environment |
An app normally touches only the plugin and tsconfig.json: the plugin passes the compiler options for you. Use
compile directly when you build tooling.