2023-04-15 03:11:12 +12:00
|
|
|
import type { Options } from 'tsup';
|
2022-09-03 04:08:16 +12:00
|
|
|
import { defineConfig } from 'tsup';
|
|
|
|
|
|
|
|
export function createTsupConfig({
|
|
|
|
entry = ['src/index.ts'],
|
|
|
|
external = [],
|
|
|
|
noExternal = [],
|
|
|
|
platform = 'node',
|
|
|
|
format = ['esm', 'cjs'],
|
|
|
|
target = 'es2022',
|
|
|
|
skipNodeModulesBundle = true,
|
|
|
|
clean = true,
|
|
|
|
shims = true,
|
|
|
|
minify = false,
|
|
|
|
splitting = false,
|
|
|
|
keepNames = true,
|
|
|
|
dts = true,
|
|
|
|
sourcemap = true,
|
2023-01-13 22:44:56 +13:00
|
|
|
esbuildPlugins = [],
|
2023-08-22 10:30:08 +12:00
|
|
|
treeshake = false,
|
2023-04-15 03:11:12 +12:00
|
|
|
}: Options = {}) {
|
2022-09-03 04:08:16 +12:00
|
|
|
return defineConfig({
|
|
|
|
entry,
|
|
|
|
external,
|
|
|
|
noExternal,
|
|
|
|
platform,
|
|
|
|
format,
|
|
|
|
skipNodeModulesBundle,
|
|
|
|
target,
|
|
|
|
clean,
|
|
|
|
shims,
|
|
|
|
minify,
|
|
|
|
splitting,
|
|
|
|
keepNames,
|
|
|
|
dts,
|
|
|
|
sourcemap,
|
2023-01-13 22:44:56 +13:00
|
|
|
esbuildPlugins,
|
2023-08-22 10:30:08 +12:00
|
|
|
treeshake,
|
2022-09-03 04:08:16 +12:00
|
|
|
});
|
|
|
|
}
|