mirror of
https://github.com/egoist/tsup.git
synced 2025-12-08 20:35:58 +00:00
parent
3ca80afe32
commit
17ac44cd2f
@ -67,6 +67,7 @@ export async function main(options: Options = {}) {
|
||||
'--silent',
|
||||
'Supress non-error logs (excluding "onSuccess" process output)'
|
||||
)
|
||||
.option('--pure <express>', 'Mark specific expressions as pure')
|
||||
.action(async (files: string[], flags) => {
|
||||
const { build } = await import('.')
|
||||
Object.assign(options, {
|
||||
|
||||
@ -101,6 +101,10 @@ export type Options = {
|
||||
* Skip node_modules bundling
|
||||
*/
|
||||
skipNodeModulesBundle?: boolean
|
||||
/**
|
||||
* @see https://esbuild.github.io/api/#pure
|
||||
*/
|
||||
pure?: string | string[]
|
||||
}
|
||||
|
||||
export type NormalizedOptions = MarkRequired<
|
||||
@ -204,6 +208,7 @@ export async function runEsbuild(
|
||||
minifySyntax: options.minifySyntax,
|
||||
keepNames: options.keepNames,
|
||||
incremental: !!options.watch,
|
||||
pure: typeof options.pure === 'string' ? [options.pure] : options.pure,
|
||||
})
|
||||
} catch (error) {
|
||||
log(format, 'error', 'Build failed')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user