OptionalaliasOptionalattwRun arethetypeswrong after bundling.
Requires @arethetypeswrong/core to be installed.
OptionalbannerOptionalbundleOptionalcjsOptionalcleanClean directories before build.
Default to output directory.
OptionalcopyCopy files to another directory.
Optionalcss[experimental] CSS options.
OptionalcustomCustom logger.
OptionalcwdThe working directory of the config file.
process.cwd() for root config.Optionaldebug[experimental] Enable debug mode.
Both debug mode and Vite DevTools are still under development, and this is for early testers only.
This may slow down the build process significantly.
OptionaldefineOptionaldtsEnables generation of TypeScript declaration files (.d.ts).
By default, this option is auto-detected based on your project's package.json:
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.
OptionalexportsGenerate package exports for package.json.
This will set the main, module, types, exports fields in package.json
to point to the generated files.
OptionalexternalOptionalfailIf true, fails the build on warnings.
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.
OptionalfooterOptionalformatOptionalfromReuse 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.
OptionalinlineBundle only the dependencies listed here; throw an error if any others are missing.
Note: Be sure to include all required sub-dependencies as well.
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.
Optionalnodetrue, add node: prefix to built-in modules.'strip', strips the node: protocol prefix from import source.false, does not modify the import source.OptionalnoOptionalonYou can specify command to be executed after a successful build, specially useful for Watch mode
OptionaloutOptionaloutCustom 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.OptionalpluginsOptionalpublicOptionalpublintRun publint after bundling.
Requires publint to be installed.
OptionalremoveIf enabled, strips the node: protocol prefix from import source.
OptionalreportEnable size reporting after bundling.
OptionalshimsOptionalsilentOptionalskipSkip bundling node_modules.
OptionalsourcemapWhether to generate source map files.
Note that this option will always be true if you have
declarationMap
option enabled in your tsconfig.json.
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'), 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 mode 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.