-
Notifications
You must be signed in to change notification settings - Fork 326
/
Copy pathtsup.config.ts
30 lines (26 loc) · 944 Bytes
/
tsup.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import type { Options } from 'tsup';
import { defineConfig } from 'tsup';
import { runAfterLast } from '../../scripts/utils';
import { version as clerkJsVersion } from '../clerk-js/package.json';
import { name, version } from './package.json';
export default defineConfig(overrideOptions => {
const isWatch = !!overrideOptions.watch;
const shouldPublish = !!overrideOptions.env?.publish;
const options: Options = {
format: 'cjs',
outDir: './dist',
entry: ['./src/**/*.{ts,tsx,js,jsx}', '!./src/**/*.test.{ts,tsx}', '!./src/**/__tests__/**'],
bundle: false,
clean: true,
minify: false,
sourcemap: true,
legacyOutput: true,
define: {
PACKAGE_NAME: `"${name}"`,
PACKAGE_VERSION: `"${version}"`,
JS_PACKAGE_VERSION: `"${clerkJsVersion}"`,
__DEV__: `${isWatch}`,
},
};
return runAfterLast(['pnpm build:declarations', shouldPublish && 'pnpm publish:local'])(options);
});