@@ -77,14 +77,16 @@ export default defineConfig({
7777| Source maps | ` sourcemap: true ` , ` 'inline' ` , ` 'hidden' ` | [ option-sourcemap] ( references/option-sourcemap.md ) |
7878| Watch mode | ` watch: true ` , watch options | [ option-watch-mode] ( references/option-watch-mode.md ) |
7979| Cleaning | ` clean: true ` , clean patterns | [ option-cleaning] ( references/option-cleaning.md ) |
80- | Log level | ` logLevel: 'silent' ` , ` failOnWarn: 'ci-only' ` | [ option-log-level] ( references/option-log-level.md ) |
80+ | Log level | ` logLevel: 'silent' ` , ` failOnWarn: false ` | [ option-log-level] ( references/option-log-level.md ) |
8181
8282## Dependency Handling
8383
8484| Feature | Usage | Reference |
8585| ---------| -------| -----------|
86- | External deps | ` external: ['react', /^@myorg\//] ` | [ option-dependencies] ( references/option-dependencies.md ) |
87- | Inline deps | ` noExternal: ['dep-to-bundle'] ` | [ option-dependencies] ( references/option-dependencies.md ) |
86+ | Never bundle | ` deps: { neverBundle: ['react', /^@myorg\//] } ` | [ option-dependencies] ( references/option-dependencies.md ) |
87+ | Always bundle | ` deps: { alwaysBundle: ['dep-to-bundle'] } ` | [ option-dependencies] ( references/option-dependencies.md ) |
88+ | Only allow bundle | ` deps: { onlyAllowBundle: ['cac', 'bumpp'] } ` - Whitelist | [ option-dependencies] ( references/option-dependencies.md ) |
89+ | Skip node_modules | ` deps: { skipNodeModulesBundle: true } ` | [ option-dependencies] ( references/option-dependencies.md ) |
8890| Auto external | Automatic peer/dependency externalization | [ option-dependencies] ( references/option-dependencies.md ) |
8991
9092## Output Enhancement
@@ -94,8 +96,9 @@ export default defineConfig({
9496| Shims | ` shims: true ` - Add ESM/CJS compatibility | [ option-shims] ( references/option-shims.md ) |
9597| CJS default | ` cjsDefault: true ` (default) / ` false ` | [ option-cjs-default] ( references/option-cjs-default.md ) |
9698| Package exports | ` exports: true ` - Auto-generate exports field | [ option-package-exports] ( references/option-package-exports.md ) |
97- | CSS handling | ** [ experimental] ** Still in development | [ option-css] ( references/option-css.md ) |
99+ | CSS handling | ** [ experimental] ** ` css: { splitting, preprocessorOptions, lightningcss } ` | [ option-css] ( references/option-css.md ) |
98100| Unbundle mode | ` unbundle: true ` - Preserve directory structure | [ option-unbundle] ( references/option-unbundle.md ) |
101+ | Executable | ** [ experimental] ** ` exe: true ` - Bundle as standalone executable, cross-platform via ` @tsdown/exe ` | [ option-exe] ( references/option-exe.md ) |
99102| Package validation | ` publint: true ` , ` attw: true ` - Validate package | [ option-lint] ( references/option-lint.md ) |
100103
101104## Framework & Runtime Support
@@ -152,7 +155,9 @@ export default defineConfig({
152155 entry: [' src/index.tsx' ],
153156 format: [' esm' , ' cjs' ],
154157 dts: true ,
155- external: [' react' , ' react-dom' ],
158+ deps: {
159+ neverBundle: [' react' , ' react-dom' ],
160+ },
156161 plugins: [
157162 // React Fast Refresh support
158163 ],
@@ -177,7 +182,7 @@ export default defineConfig({
177182 entry: [' src/index.ts' ],
178183 format: [' esm' , ' cjs' ],
179184 dts: true ,
180- failOnWarn: ' ci-only' ,
185+ failOnWarn: ' ci-only' , // opt-in: fail on warnings in CI
181186 publint: ' ci-only' ,
182187 attw: ' ci-only' ,
183188})
@@ -195,6 +200,48 @@ export default defineConfig({
195200})
196201```
197202
203+ ### Library with CSS and Sass
204+
205+ ``` ts
206+ export default defineConfig ({
207+ entry: [' src/index.ts' ],
208+ format: [' esm' , ' cjs' ],
209+ dts: true ,
210+ target: ' chrome100' ,
211+ css: {
212+ preprocessorOptions: {
213+ scss: {
214+ additionalData: ` @use "src/styles/variables" as *; ` ,
215+ },
216+ },
217+ },
218+ })
219+ ```
220+
221+ ### Standalone Executable
222+
223+ ``` ts
224+ export default defineConfig ({
225+ entry: [' src/cli.ts' ],
226+ exe: true ,
227+ })
228+ ```
229+
230+ ### Cross-Platform Executable (requires ` @tsdown/exe ` )
231+
232+ ``` ts
233+ export default defineConfig ({
234+ entry: [' src/cli.ts' ],
235+ exe: {
236+ targets: [
237+ { platform: ' linux' , arch: ' x64' , nodeVersion: ' 25.7.0' },
238+ { platform: ' darwin' , arch: ' arm64' , nodeVersion: ' 25.7.0' },
239+ { platform: ' win' , arch: ' x64' , nodeVersion: ' 25.7.0' },
240+ ],
241+ },
242+ })
243+ ```
244+
198245### Advanced with Hooks
199246
200247``` ts
@@ -277,6 +324,7 @@ tsdown --format esm,cjs # Multiple formats
277324tsdown --outDir lib # Custom output directory
278325tsdown --minify # Enable minification
279326tsdown --dts # Generate declarations
327+ tsdown --exe # Bundle as standalone executable
280328
281329# Entry options
282330tsdown src/index.ts # Single entry
@@ -298,7 +346,7 @@ tsdown --clean # Clean output directory
298346
2993472 . ** Externalize dependencies** to avoid bundling unnecessary code:
300348 ``` ts
301- { external : [/ ^ react/ , / ^ @myorg\/ / ] }
349+ { deps : { neverBundle : [/ ^ react/ , / ^ @myorg\/ / ] } }
302350 ```
303351
3043523 . ** Use tree shaking** for optimal bundle size:
0 commit comments