-
Notifications
You must be signed in to change notification settings - Fork 448
Expand file tree
/
Copy pathtsdown.config.mts
More file actions
29 lines (25 loc) · 969 Bytes
/
tsdown.config.mts
File metadata and controls
29 lines (25 loc) · 969 Bytes
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
import type { Options } from 'tsdown';
import { defineConfig } from 'tsdown';
import { runAfterLast } from '../../scripts/utils.ts';
import clerkJsPkgJson from '../clerk-js/package.json' with { type: 'json' };
import pkgJson from './package.json' with { type: '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,
define: {
PACKAGE_NAME: `"${pkgJson.name}"`,
PACKAGE_VERSION: `"${pkgJson.version}"`,
JS_PACKAGE_VERSION: `"${clerkJsPkgJson.version}"`,
__DEV__: `${isWatch}`,
},
};
return runAfterLast(['pnpm build:declarations', shouldPublish && 'pkglab pub --ping'])(options);
});