forked from rolldown/tsdown
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsdown.config.ts
More file actions
72 lines (71 loc) · 1.58 KB
/
tsdown.config.ts
File metadata and controls
72 lines (71 loc) · 1.58 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
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}.ts'],
name: 'tsdown',
inlineOnly: [
'@publint/pack',
'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: {
customExports(exports) {
exports['./client'] = './client.d.ts'
return exports
},
},
plugins: [
RequireCJS(),
DtsSnapshot(),
AST({
exclude: ['**/*.d.ts'],
transformer: [RemoveNode((node) => isCallOf(node, 'typeAssert'))],
}),
],
onSuccess() {
console.info('🙏 Build succeeded!')
},
},
{
workspace: {
include: ['packages/*'],
},
inlineOnly: [],
failOnWarn: 'ci-only',
publint: 'ci-only',
attw: {
enabled: 'ci-only',
profile: 'esm-only',
},
treeshake: {
moduleSideEffects: false,
},
exports: true,
},
])