-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsup.config.ts
More file actions
48 lines (41 loc) · 1014 Bytes
/
tsup.config.ts
File metadata and controls
48 lines (41 loc) · 1014 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { defineConfig } from 'tsup'
import * as preset from 'tsup-preset-solid'
const preset_options: preset.PresetOptions = {
entries: [
{
entry: 'src/index.ts',
dev_entry: true,
},
{
entry: 'src/esbuild.ts',
},
{
entry: 'src/rollup.ts',
},
{
entry: 'src/rspack.ts',
},
{
entry: 'src/vite.ts',
},
{
entry: 'src/webpack.ts',
},
],
drop_console: true,
cjs: true,
modify_esbuild_options(esbuildOptions) {
esbuildOptions.external = ['vite']
return esbuildOptions
},
}
export default defineConfig((config) => {
const watching = !!config.watch
const parsed_options = preset.parsePresetOptions(preset_options, watching)
if (!watching) {
const package_fields = preset.generatePackageExports(parsed_options)
console.log(`package.json: \n\n${JSON.stringify(package_fields, null, 2)}\n\n`)
preset.writePackageJson(package_fields)
}
return preset.generateTsupOptions(parsed_options)
})