-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtsup.config.ts
67 lines (60 loc) · 1.7 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import { defineConfig } from 'tsup'
import * as glob from 'glob'
// 🔍 Use glob to synchronize and retrieve all TypeScript files from the src directory
const entries = glob.sync('./src/*.ts')
// 📜 Log the entries to the console for debugging purposes
console.log(entries)
// 🛠️ Export the configuration for tsup build tool
export default defineConfig({
/**
* 🎯 Entry points for the build process.
* This specifies which files will be bundled.
*
* @type {string[]}
* @example
* // Example of entry points:
* const entries = ['./src/index.ts', './src/utils.ts'];
*/
entry: entries,
/**
* 📦 Format options for the output.
* This defines the module formats to generate.
*
* @type {('cjs' | 'esm')[]}
* @default ['cjs', 'esm']
*/
format: ['cjs', 'esm'], // Build for commonJS and ESmodules
/**
* 🗒️ Flag to enable generation of TypeScript declaration files.
* When true, a .d.ts file will be created.
*
* @type {boolean}
* @default true
*/
dts: true, // Generate declaration file (.d.ts)
/**
* 🔄 Enable or disable code splitting.
* If true, it will create separate chunks for
* dynamic imports.
*
* @type {boolean}
* @default false
*/
splitting: false,
/**
* 📍 Enable source maps for easier debugging.
* When true, a source map file will be generated.
*
* @type {boolean}
* @default true
*/
sourcemap: true,
/**
* 🧹 Clean the output directory before each build.
* If true, it will remove previous builds.
*
* @type {boolean}
* @default true
*/
clean: true
})