-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsup.config.ts
More file actions
47 lines (42 loc) · 962 Bytes
/
Copy pathtsup.config.ts
File metadata and controls
47 lines (42 loc) · 962 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
// tsup.config.ts
import { defineConfig } from 'tsup'
export default defineConfig({
entry: ['src/index.ts'],
format: ['esm', 'cjs'],
dts: true,
sourcemap: true,
clean: true,
splitting: false,
treeshake: true,
target: 'es2022',
// All peer dependencies and Node built-ins should be external
external: [
'node:fs',
'node:path',
'fs',
'path',
'vite',
'puppeteer',
],
esbuildOptions(opts) {
opts.platform = 'node'
opts.conditions = ['import', 'require']
opts.mainFields = ['module', 'main']
opts.target = 'es2022'
},
outExtension({ format }) {
return { js: format === 'cjs' ? '.cjs' : '.js' }
},
banner: {
js: `/**
* bini-export v1.0.2
* Static export for Bini.js with true SSG
*
* Pre-renders React routes to static HTML via headless browser.
* Optimized for GitHub Pages, Netlify, Vercel, and other static hosts.
*
* @author Binidu Ranasinghe
* @license MIT
*/`
}
})