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
Type: object | object | array

Any of

1. object object
tsup object | array required
One of: options object, options[] options[]
2. object | array object | array

Definitions

options object

Configuration options for tsup

entry string[] | object

Files that each serve as an input to the bundling algorithm.


References:

treeshake boolean | string

By default esbuild already does treeshaking but this option allow you to perform additional treeshaking with Rollup and result in smaller bundle size.

name string

Optional config name to show in CLI output

legacyOutput boolean

Output different formats to different folder instead of using different extension

target string | string[]

This sets the target environment for the generated code


References:

Default: "node14"
minify boolean | string

When enabled, the generated code will be minified instead of pretty-printed.

minifyWhitespace boolean
minifyIdentifiers boolean
minifySyntax boolean
keepNames boolean
watch boolean | string | string | boolean[]
ignoreWatch string | string[]
onSuccess string
jsxFactory string
jsxFragment string
outDir string
format string | string[]
swc object
globalName string
env object
define object
dts boolean | string | object

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.

sourcemap boolean | enum
noExternal string[]

Always bundle modules matching given patterns

external string[]

Don't bundle these modules

replaceNodeEnv boolean

Replace process.env.NODE_ENV with production or development production when the bundled is minified, development otherwise

splitting boolean

You may want to disable code splitting sometimes: #255

Default: true
clean boolean | string[]

Clean output directory before each buil

silent boolean

Suppress non-error logs (excluding "onSuccess" process output)

skipNodeModulesBundle boolean

Skip node_modules bundling

pure boolean | string[]

See:

bundle boolean

Disable bundling, default to true

Default: true
inject string[]

This option allows you to automatically replace a global variable with an import from another file.


See:

metafile boolean

Emit esbuild metafile.


See:

footer object
2 nested properties
js string
css string
banner object
2 nested properties
js string
css string
platform string

Target platform

Default: "node"
Values: "node" "browser" "neutral"
config boolean | string

Disable config file with false or pass a custom config filename

tsconfig string

Use a custom tsconfig

injectStyle boolean

Inject CSS as style tags to document head

Default: false
shims boolean

Inject cjs and esm shims if needed

Default: false