tsup
Configuration options for tsup
| Type | object | object | array |
|---|---|
| File match |
tsup.config.json
|
| Schema URL | https://catalog.lintel.tools/schemas/schemastore/tsup/latest.json |
| Source | https://cdn.jsdelivr.net/npm/tsup/schema.json |
Validate with Lintel
npx @lintel/lintel check
Any of
Definitions
Configuration options for tsup
Files that each serve as an input to the bundling algorithm.
References:
- Entry Points - esbuild
- Multiple Entrypoints - tsup
By default esbuild already does treeshaking but this option allow you to perform additional treeshaking with Rollup and result in smaller bundle size.
Optional config name to show in CLI output
Output different formats to different folder instead of using different extension
When enabled, the generated code will be minified instead of pretty-printed.
This will emit ./dist/index.js and ./dist/index.d.ts.
If you have multiple entry files, each entry will get a corresponding .d.ts file. So when you only want to generate declaration file for a single entry, use --dts <entry> format, e.g. --dts src/index.ts.
Note that --dts does not resolve external (aka in node_modules) types used in the .d.ts file, if that's somehow a requirement, try the experimental --dts-resolve flag instead.
Always bundle modules matching given patterns
Don't bundle these modules
Replace process.env.NODE_ENV with production or development production when the bundled is minified, development otherwise
You may want to disable code splitting sometimes: #255
Clean output directory before each buil
Suppress non-error logs (excluding "onSuccess" process output)
Skip node_modules bundling
See:
- Pure - esbuild
Disable bundling, default to true
This option allows you to automatically replace a global variable with an import from another file.
See:
- Inject - esbuild
2 nested properties
2 nested properties
Target platform
Disable config file with false or pass a custom config filename
Use a custom tsconfig
Inject CSS as style tags to document head
Inject cjs and esm shims if needed