-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.config.ts
More file actions
65 lines (64 loc) · 1.52 KB
/
Copy pathbuild.config.ts
File metadata and controls
65 lines (64 loc) · 1.52 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
import { defineBuildConfig } from 'unbuild';
export default defineBuildConfig({
entries: [
// Main entry point
{
input: 'src/index',
outDir: 'dist',
name: 'index',
declaration: false,
externals: [
'@refinedev/core',
'@cloudflare/workers-types',
'drizzle-orm',
],
builder: 'rollup',
rollup: {
output: {
format: 'esm',
// Preserve all exports from entry point
preserveEntrySignatures: 'allow-extension',
// Enable tree-shaking but keep re-exports
interop: 'auto',
},
},
},
// D1 helper entry point
{
input: 'src/d1',
outDir: 'dist',
name: 'd1',
declaration: false,
externals: [
'@refinedev/core',
'@cloudflare/workers-types',
'drizzle-orm',
],
},
// CLI entry point
{
input: 'bin/refine-sqlx',
outDir: 'dist',
name: 'refine-sqlx',
builder: 'rollup',
declaration: false,
rollup: {
esbuild: {
minify: false,
target: 'es2022',
banner: '#!/usr/bin/env node',
},
output: { format: 'esm' },
// Simple externals for CLI
external: (id) => id.startsWith('node:') || id === 'drizzle-kit' || id.startsWith('drizzle-kit/'),
},
},
],
outDir: 'dist',
declaration: false,
rollup: {
esbuild: { minify: true, target: 'es2022', treeShaking: true },
emitCJS: false, // Pure ESM
},
failOnWarn: false,
});