-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathtsup.config.js
More file actions
51 lines (49 loc) · 919 Bytes
/
Copy pathtsup.config.js
File metadata and controls
51 lines (49 loc) · 919 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
49
50
51
import { defineConfig } from 'tsup';
const cfg = {
splitting: false,
sourcemap: true,
clean: true,
treeshake: false,
dts: true,
format: ['esm', 'cjs'],
};
export default defineConfig([
{
...cfg,
entry: {
index: 'src/server/index.ts',
},
external: ['next'],
outDir: 'dist/server',
},
{
...cfg,
entry: {
index: 'src/server/app-router-index.ts',
},
external: ['next'],
outDir: 'dist/server/app-router',
},
{
...cfg,
entry: {
index: 'src/server/pages-index.ts',
},
external: ['next'],
outDir: 'dist/server/pages',
},
{
...cfg,
entry: {
index: 'src/client/index.ts',
},
external: ['react'],
outDir: 'dist/client',
esbuildOptions: (options) => {
// Append "use client" to the top of the react entry point
options.banner = {
js: '"use client";',
};
},
},
]);