TypeScript Compiler Options

allowUmdGlobalAccess — TypeScript compiler option

Permits UMD globals in module files. It does not create the runtime global; the host must supply it. Default (5.8.3): false. Create the labeled files in an isolated project and run tsc -p tsconfig.json. No diagnostics; output: none. Local project fixture, not a single-file editor.

Formal Syntax & Structure

typescript syntaxtypescript
{  "compilerOptions": {    "allowUmdGlobalAccess": true  }}

Parameters & Attributes

NameTypeDescription
allowUmdGlobalAccessbooleanSet in compilerOptions; default: false.

Working Example

Example Snippettypescript
// File: tsconfig.json (omit this label){  "compilerOptions": {    "target": "ES2022",    "module": "CommonJS",    "strict": true,    "types": [],    "noEmitOnError": true,    "noEmit": true,    "allowUmdGlobalAccess": true  },  "files": [    "umd.d.ts",    "main.ts"  ]}// File: umd.d.tsexport as namespace Widget;export function size(): number;// File: main.tsexport {};const n: number = Widget.size();
TypeScript Reference