forked from chromaui/chromatic-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tsup.config.ts
44 lines (43 loc) · 1.1 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import { defineConfig } from 'tsup';
export default defineConfig((options) => [
{
entry: {
bin: 'bin-src/register.js',
node: 'node-src/index.ts',
},
splitting: true,
minify: !options.watch,
format: ['cjs'],
dts: {
entry: { node: 'node-src/index.ts' },
resolve: true,
},
treeshake: true,
sourcemap: true,
clean: true,
platform: 'node',
target: 'node16', // Storybook still supports Node 16
env: {
SENTRY_ENVIRONMENT: process.env.CI ? 'production' : 'development',
SENTRY_RELEASE: process.env.SENTRY_RELEASE || 'development',
SENTRY_DIST: 'cli',
},
},
{
entry: ['action-src/register.js'],
outDir: 'action',
splitting: false,
minify: !options.watch,
format: ['cjs'],
treeshake: true,
sourcemap: true,
clean: true,
platform: 'node',
target: 'node20', // Sync with `runs.using` in action.yml
env: {
SENTRY_ENVIRONMENT: process.env.CI ? 'production' : 'development',
SENTRY_RELEASE: process.env.SENTRY_RELEASE || 'development',
SENTRY_DIST: 'action',
},
},
]);