OptionalaliasOptionalattwRun arethetypeswrong after bundling.
Requires @arethetypeswrong/core to be installed.
OptionalbannerOptionalbundleUse unbundle instead.
OptionalchecksControls which warnings are emitted during the build process. Each option can be set to true (emit warning) or false (suppress warning).
OptionalcjsOptionalcleanClean directories before build.
Default to output directory.
OptionalconfigConfig file path
OptionalconfigConfig loader to use. It can only be set via CLI or API.
OptionalcopyCopy files to another directory.
Optionalcss[experimental] CSS options.
Requires @tsdown/css to be installed.
OptionalcustomCustom logger.
OptionalcwdThe working directory of the config file.
process.cwd() for root config.workspace config.OptionaldefineOptionaldepsDependency handling options.
Optionaldevtools[experimental] Enable devtools.
DevTools is still under development, and this is for early testers only.
This may slow down the build process significantly.
OptionaldtsEnables generation of TypeScript declaration files (.d.ts).
By default, this option is auto-detected based on your project's package.json:
exe is enabled, declaration file generation is disabled by default.types field is present, or if the main exports contains a types entry, declaration file generation is enabled by default.OptionalentryDefaults to 'src/index.ts' if it exists.
Supports glob patterns with negation to exclude files:
OptionalenvCompile-time env variables, which can be accessed via import.meta.env or process.env.
OptionalenvPath to env file providing compile-time env variables.
OptionalenvWhen loading env variables from envFile, only include variables with these prefixes.
Optionalexe[experimental] Bundle as executable using Node.js SEA (Single Executable Applications).
This will bundle the output into a single executable file using Node.js SEA. Note that this is only supported on Node.js 25.7.0 and later, and is not supported in Bun or Deno.
OptionalexportsGenerate package exports for package.json.
This will set the exports field in package.json to point to the
generated files.
OptionalexternalUse deps.neverBundle instead.
OptionalfailIf true, fails the build on warnings.
OptionalfilterFilter configs by cwd or name.
OptionalfixedUse a fixed extension for output files.
The extension will always be .cjs or .mjs.
Otherwise, it will depend on the package type.
Defaults to true if platform is set to node,
false otherwise.
OptionalfooterOptionalformatOutput format(s). Available formats are
esm: ESMcjs: CommonJSiife: IIFEumd: UMDOptionalfromReuse config from Vite or Vitest (experimental)
OptionalglobalOptionalglobimport.meta.glob support.
OptionalhashIf enabled, appends hash to chunk filenames.
OptionalhooksOptionalignoreFiles or patterns to not watch while in watch mode.
OptionalinjectUse css.inject instead.
OptionalinlineUse deps.onlyBundle instead.
OptionalinputUse with caution; ensure you understand the implications.
OptionalloaderSets how input files are processed. For example, use 'js' to treat files as JavaScript or 'base64' for images. Lets you import or require files like images or fonts.
OptionallogLog level.
OptionalminifyOptionalnameThe name to show in CLI output. This is useful for monorepos or workspaces. When using workspace mode, this option defaults to the package name from package.json. In non-workspace mode, this option must be set explicitly for the name to show in the CLI output.
OptionalnodeControl whether built-in Node.js module imports use the node: protocol.
true: Add the node: prefix to built-in module imports.'strip': Remove the node: prefix from built-in module imports.false: Do not transform built-in module imports.OptionalnoUse deps.alwaysBundle instead.
OptionalonYou can specify command to be executed after a successful build, specially useful for Watch mode
OptionaloutOptionaloutUse outExtensions instead.
OptionaloutCustom extensions for output files.
fixedExtension will be overridden by this option.
OptionaloutputUse with caution; ensure you understand the implications.
OptionalplatformSpecifies the target runtime platform for the build.
node: Node.js and compatible runtimes (e.g., Deno, Bun).
For CJS format, this is always set to node and cannot be changed.neutral: A platform-agnostic target with no specific runtime assumptions.browser: Web browsers.OptionalpluginsOptionalpublicAlias for copy, will be removed in the future.
OptionalpublintRun publint after bundling.
Requires publint to be installed.
OptionalremoveRemove the node: prefix from built-in Node.js module imports.
When enabled, rewrites import sources like node:fs to fs.
Use nodeProtocol: 'strip' instead.
OptionalreportEnable size reporting after bundling.
OptionalrootSpecifies the root directory of input files, similar to TypeScript's rootDir.
This determines the output directory structure.
By default, the root is computed as the common base directory of all entry files.
OptionalshimsOptionalskipUse deps.skipNodeModulesBundle instead.
OptionalsourcemapWhether to generate source map files.
Note that this option will always be true if you have
declarationMap
option enabled in your tsconfig.json.
OptionalsuppressSuppress warnings whose message matches the given pattern(s).
Accepts a string (substring match), a RegExp, an array of either, or a
predicate function. Matched warnings are dropped before failOnWarn is
applied, so they won't fail the build.
OptionaltargetSpecifies the compilation target environment(s).
Determines the JavaScript version or runtime(s) for which the code should be compiled.
If not set, defaults to the value of engines.node in your project's package.json.
If no engines.node field exists, no syntax transformations are applied.
Accepts a single target (e.g., 'es2020', 'node18', 'baseline-widely-available'), an array of targets, or false to disable all transformations.
https://tsdown.dev/options/target#supported-targets for a list of valid targets and more details.
OptionaltreeshakeConfigure tree shaking options.
https://rolldown.rs/options/treeshake for more details.
OptionaltsconfigOptionalunbundleDetermines whether unbundle is enabled.
When set to true, the output files will mirror the input file structure.
OptionalunusedEnable unused dependencies check with unplugin-unused
Requires unplugin-unused to be installed.
OptionalwatchOptionalworkspace[experimental] Enable workspace mode. This allows you to build multiple packages in a monorepo.
OptionalwriteWhether to write the files to disk. This option is incompatible with watch mode.
Options for tsdown.