{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://www.schemastore.org/tsbuild.json","title":"tsbuild tsconfig schema extension","description":"Extends the standard tsconfig schema with the tsbuild property.","type":"object","allOf":[{"$ref":"https://json.schemastore.org/jsconfig.json"},{"type":"object","properties":{"tsbuild":{"$ref":"#/definitions/options","markdownDescription":"tsbuild-specific build options inside tsconfig.json."}}}],"definitions":{"options":{"type":"object","markdownDescription":"Configuration options for tsbuild.","additionalProperties":false,"properties":{"entryPoints":{"markdownDescription":"Files that each serve as an input to the bundling algorithm. Can be an array of paths or an object mapping output names to input paths.\n\nWhen omitted, tsbuild auto-infers entry points from the `exports`, `bin`, `main`, or `module` fields in `package.json` by reverse-mapping output paths to source paths.","examples":[["./src/index.ts","./src/cli.ts"],{"index":"./src/index.ts","cli":"./src/cli.ts"}],"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"object","additionalProperties":{"type":"string"}}]},"platform":{"description":"Target platform. Auto-detected from tsconfig lib (DOM = browser, no DOM = node). Override if needed.","type":"string","enum":["node","browser","neutral"],"markdownEnumDescriptions":["Node.js runtime output.","Browser runtime output.","Environment-agnostic output."],"examples":["node"]},"bundle":{"description":"Whether to bundle source files together. When false, each file is output separately.","type":"boolean","default":true},"clean":{"description":"Remove all files from the output directory before building. Defaults to true.","type":"boolean","default":true},"packages":{"description":"Default behavior for node_modules dependencies. 'bundle' includes them in output, 'external' keeps them as imports. When omitted, tsbuild auto-selects based on platform and noExternal.","type":"string","enum":["bundle","external"],"markdownEnumDescriptions":["Bundle package contents into output files.","Keep package imports as external specifiers."],"examples":["external"]},"external":{"description":"Specific dependencies to externalize (don't bundle). In tsconfig.json this must be strings (RegExp patterns are only supported via the programmatic API).","type":"array","examples":[["typescript","esbuild"]],"items":{"type":"string"}},"noExternal":{"description":"Specific dependencies to bundle (overrides packages setting). In tsconfig.json this must be strings (RegExp patterns are only supported via the programmatic API).","type":"array","examples":[["lodash-es"]],"items":{"type":"string"}},"dts":{"markdownDescription":"Generate TypeScript declaration files.\n\n---\n**Note**: By default, external types from `node_modules` are kept as import statements and not bundled.","type":"object","properties":{"entryPoints":{"type":"array","description":"Names of the project's entryPoints to be used to generate the DTS files","items":{"type":"string"}},"resolve":{"type":"boolean","description":"Bundle external types from node_modules into declaration files. When false, external imports remain as import statements. Defaults to false for 'node' platform, true for 'browser' and 'neutral' platforms."}},"additionalProperties":false,"examples":[{"entryPoints":["index"],"resolve":false}]},"env":{"type":"object","description":"Environment variables to define (accessible via import.meta.env)","examples":[{"API_URL":"https://api.example.com"}],"additionalProperties":{"type":"string"}},"minify":{"type":"boolean","description":"When enabled, the generated code will be minified instead of pretty-printed."},"sourceMap":{"oneOf":[{"type":"boolean"},{"type":"string","enum":["inline","external","both"],"markdownEnumDescriptions":["Embed source maps directly in generated files.","Emit separate .map files.","Emit both inline and external source maps."]}],"description":"Generate source maps. Options: true/false, 'inline', 'external', or 'both'. Overrides tsconfig.json compilerOptions.sourceMap.","examples":[true,"external"]},"splitting":{"type":"boolean","description":"Enable code splitting for better caching and parallel loading","examples":[true]},"banner":{"type":"object","description":"Insert content at the beginning of generated files (e.g., shebang for CLI tools)","properties":{"js":{"type":"string","description":"Banner text for JavaScript files"},"css":{"type":"string","description":"Banner text for CSS files"}},"additionalProperties":false,"examples":[{"js":"#!/usr/bin/env node"}]},"footer":{"type":"object","description":"Insert content at the end of generated files (e.g., copyright notices)","properties":{"js":{"type":"string","description":"Footer text for JavaScript files"},"css":{"type":"string","description":"Footer text for CSS files"}},"additionalProperties":false,"examples":[{"js":"/* (c) Example Corp */"}]},"plugins":{"type":"array","markdownDescription":"Custom esbuild plugins to include in the build. Each entry is either:\n- A **string** — npm package name or relative path to a plugin module (default export must be a factory function or Plugin object)\n- A **tuple** `[string, object]` — module specifier with options passed to the factory function\n\nExample:\n```json\n\"plugins\": [\n  \"esbuild-plugin-copy\",\n  [\"esbuild-plugin-alias\", { \"aliases\": { \"@\": \"./src\" } }]\n]\n```","items":{"oneOf":[{"type":"string","description":"Plugin module specifier (npm package or relative path)"},{"type":"array","description":"Plugin module specifier with options: [specifier, options]","items":[{"type":"string","description":"Plugin module specifier (npm package or relative path)"},{"type":"object","description":"Options passed to the plugin factory function","additionalProperties":true}],"additionalItems":false,"minItems":2,"maxItems":2}]}},"iife":{"markdownDescription":"Produce additional IIFE (Immediately Invoked Function Expression) output alongside the primary ESM build.\n\nWhen enabled, each `.js` entry point is wrapped in an IIFE and written to an `iife/` subdirectory under the output directory.\n\nSet to `true` for default behavior, or provide an object with a `globalName` to assign exports to `globalThis`.\n\nExample:\n```json\n\"iife\": { \"globalName\": \"MyLib\" }\n```","oneOf":[{"type":"boolean"},{"type":"object","properties":{"globalName":{"type":"string","description":"Global variable name for the IIFE bundle (e.g., 'MyLib' becomes globalThis.MyLib)"}},"additionalProperties":false}]}}}}}