2024-05-21 09:39:37 +00:00
|
|
|
import { parseArgs } from 'node:util';
|
2023-02-26 08:54:32 +00:00
|
|
|
import { defineConfig } from 'tsup';
|
|
|
|
|
import {
|
|
|
|
|
commonWatchList,
|
|
|
|
|
monorepoWatchList,
|
|
|
|
|
targetFromNodeVersion,
|
|
|
|
|
watchEntryPlugin,
|
|
|
|
|
} from './utils';
|
|
|
|
|
|
2024-05-21 09:39:37 +00:00
|
|
|
const entryPoints = parseArgs({
|
|
|
|
|
allowPositionals: true,
|
|
|
|
|
strict: false,
|
|
|
|
|
}).positionals;
|
|
|
|
|
|
2023-02-26 08:54:32 +00:00
|
|
|
export default defineConfig({
|
2024-05-21 09:39:37 +00:00
|
|
|
entryPoints: entryPoints.length ? entryPoints : ['src/index.ts'],
|
2023-02-26 08:54:32 +00:00
|
|
|
splitting: false,
|
|
|
|
|
sourcemap: true,
|
|
|
|
|
clean: true,
|
|
|
|
|
shims: true,
|
|
|
|
|
format: 'esm',
|
2024-04-07 08:57:03 +00:00
|
|
|
watch: process.env.WATCH === '0' ? false : [...commonWatchList(), ...monorepoWatchList()],
|
2023-02-26 08:54:32 +00:00
|
|
|
target: targetFromNodeVersion(),
|
|
|
|
|
plugins: [watchEntryPlugin()],
|
|
|
|
|
});
|