-
-
Notifications
You must be signed in to change notification settings - Fork 158
Expand file tree
/
Copy pathtsdown.config.ts
More file actions
73 lines (72 loc) · 1.56 KB
/
tsdown.config.ts
File metadata and controls
73 lines (72 loc) · 1.56 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import { DtsSnapshot } from 'rolldown-plugin-dts-snapshot'
import { RequireCJS } from 'rolldown-plugin-require-cjs'
import { isCallOf } from 'unplugin-ast/ast-kit'
import AST from 'unplugin-ast/rolldown'
import { RemoveNode } from 'unplugin-ast/transformers'
import { defineConfig } from './src/config.ts'
export default defineConfig([
{
entry: ['./src/{index,run,plugins,config,internal}.ts'],
name: 'tsdown',
deps: {
onlyBundle: [
'is-in-ci',
'package-manager-detector',
'pkg-types', // type-only
],
},
platform: 'node',
failOnWarn: 'ci-only',
define: {
'import.meta.TSDOWN_PRODUCTION': 'true',
},
dts: true,
unused: {
level: 'error',
ignore: [
'typescript', // Yarn PnP
],
},
treeshake: {
moduleSideEffects: false,
},
publint: 'ci-only',
attw: {
enabled: 'ci-only',
profile: 'esm-only',
},
exports: {
devExports: 'dev',
customExports: {
'./client': './client.d.ts',
},
bin: true,
},
plugins: [
RequireCJS(),
DtsSnapshot(),
AST({
exclude: ['**/*.d.ts'],
transformer: [RemoveNode((node) => isCallOf(node, 'typeAssert'))],
}),
],
},
{
workspace: {
include: ['packages/*'],
},
deps: { onlyBundle: [] },
failOnWarn: 'ci-only',
publint: 'ci-only',
attw: {
enabled: 'ci-only',
profile: 'esm-only',
},
treeshake: {
moduleSideEffects: false,
},
exports: {
devExports: 'dev',
},
},
])