Skip to content

weapp-vite / TsupOptions

类型别名: TsupOptions

TsupOptions: object

定义于: node_modules/.pnpm/tsup@8.3.5_@swc+core@1.10.7_jiti@2.4.2_postcss@8.5.1_tsx@4.19.2_typescript@5.7.3_yaml@2.7.0/node_modules/tsup/dist/index.d.ts:397

The options available in tsup.config.ts Not all of them are available from CLI flags

类型声明

optional banner: BannerOrFooter

bundle?

optional bundle: boolean

Disable bundling, default to true

cjsInterop?

optional cjsInterop: boolean

Interop default within module.exports in cjs

默认值

ts
false

clean?

optional clean: boolean | string[]

Clean output directory before each build

config?

optional config: boolean | string

Disable config file with false Or pass a custom config filename

define?

optional define: object

索引签名

[k: string]: string

dts?

optional dts: boolean | string | DtsConfig

entry?

optional entry: Entry

entryPoints?

optional entryPoints: Entry

已被弃用

Use entry instead

env?

optional env: object

索引签名

[k: string]: string

esbuildOptions()?

optional esbuildOptions: (options, context) => void

参数

options

BuildOptions

context
format

Format

返回

void

esbuildPlugins?

optional esbuildPlugins: Plugin$1[]

experimentalDts?

optional experimentalDts: boolean | string | ExperimentalDtsConfig

external?

optional external: (string | RegExp)[]

Don't bundle these modules

optional footer: BannerOrFooter

format?

optional format: Format[] | Format

globalName?

optional globalName: string

ignoreWatch?

optional ignoreWatch: string[] | string

inject?

optional inject: string[]

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

参阅

https://esbuild.github.io/api/#inject

injectStyle?

optional injectStyle: boolean | (css, fileId) => string | Promise<string>

Inject CSS as style tags to document head

默认值

ts
{false}

jsxFactory?

optional jsxFactory: string

jsxFragment?

optional jsxFragment: string

keepNames?

optional keepNames: boolean

killSignal?

optional killSignal: KILL_SIGNAL

legacyOutput?

optional legacyOutput: boolean

Output different formats to different folder instead of using different extensions

loader?

optional loader: Record<string, Loader>

Esbuild loader option

metafile?

optional metafile: boolean

Emit esbuild metafile

参阅

https://esbuild.github.io/api/#metafile

minify?

optional minify: boolean | "terser"

minifyIdentifiers?

optional minifyIdentifiers: boolean

minifySyntax?

optional minifySyntax: boolean

minifyWhitespace?

optional minifyWhitespace: boolean

name?

optional name: string

Optional config name to show in CLI output

noExternal?

optional noExternal: (string | RegExp)[]

Always bundle modules matching given patterns

onSuccess?

optional onSuccess: string | () => Promise<void | undefined | () => void | Promise<void>>

outDir?

optional outDir: string

outExtension?

optional outExtension: OutExtensionFactory

platform?

optional platform: "node" | "browser" | "neutral"

Target platform

默认值

node

plugins?

optional plugins: Plugin[]

Experimental Alpha

TSUP plugins

publicDir?

optional publicDir: string | boolean

Copy the files inside publicDir to output directory

pure?

optional pure: string | string[]

参阅

https://esbuild.github.io/api/#pure

removeNodeProtocol?

optional removeNodeProtocol: boolean

Remove node: protocol from imports

The default value will be flipped to false in the next major release

默认值

ts
true

replaceNodeEnv?

optional replaceNodeEnv: boolean

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

shims?

optional shims: boolean

Inject cjs and esm shims if needed

默认值

ts
false

silent?

optional silent: boolean

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

skipNodeModulesBundle?

optional skipNodeModulesBundle: boolean

Skip node_modules bundling Will still bundle modules matching the noExternal option

sourcemap?

optional sourcemap: boolean | "inline"

splitting?

optional splitting: boolean

Code splitting Default to true for ESM, false for CJS.

You can set it to true explicitly, and may want to disable code splitting sometimes: #255

target?

optional target: Target | Target[]

Compile target

default to node16

terserOptions?

optional terserOptions: MinifyOptions

treeshake?

optional treeshake: TreeshakingStrategy

By default esbuild already does treeshaking

But this option allow you to perform additional treeshaking with Rollup

This can result in smaller bundle size

tsconfig?

optional tsconfig: string

Use a custom tsconfig

watch?

optional watch: boolean | string | (string | boolean)[]

Released under the MIT License.