-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsup.config.ts
More file actions
51 lines (49 loc) · 1.34 KB
/
tsup.config.ts
File metadata and controls
51 lines (49 loc) · 1.34 KB
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
45
46
47
48
49
50
51
import { defineConfig } from 'tsup';
import { readFileSync } from 'fs';
const packageJson = JSON.parse(readFileSync('./package.json', 'utf-8'));
export default defineConfig([
// Browser 엔트리 (라이브러리)
{
entry: {
client: 'src/client.ts',
devtools: 'src/devtools/index.ts',
},
format: ['esm', 'cjs'],
platform: 'browser',
target: 'es2020',
outDir: 'dist',
dts: true,
external: [
'postcss',
'postcss-safe-parser',
'fs',
'node:fs',
'path',
'node:path',
'url',
'node:url',
],
clean: false,
outExtension: ({ format }) => ({
js: format === 'cjs' ? '.cjs' : '.js',
}),
},
{
entry: { cli: 'src/cli/index.ts' },
format: ['cjs'],
platform: 'node',
target: 'node18',
outDir: 'dist',
dts: false,
splitting: false,
external: ['postcss', 'postcss-safe-parser', 'chokidar'],
tsconfig: 'tsconfig.node.json',
clean: false,
outExtension: ({ format }) => ({
js: format === 'cjs' ? '.cjs' : '.js',
}),
define: {
'process.env.COLBRUSH_VERSION': JSON.stringify(packageJson.version),
},
},
]);