forked from evolution-foundation/evolution-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsup.config.ts
More file actions
29 lines (26 loc) · 864 Bytes
/
Copy pathtsup.config.ts
File metadata and controls
29 lines (26 loc) · 864 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
import { cpSync } from 'node:fs';
import { defineConfig } from 'tsup';
// Build-time licensing URL — passed via env vars only at build time, baked
// into the bundle by `define`. See src/licensing/endpoint.ts.
const licenseEndpointEncoded = JSON.stringify(process.env.LICENSE_ENDPOINT_ENCODED ?? '');
const licenseEndpointXorKey = JSON.stringify(process.env.LICENSE_ENDPOINT_XOR_KEY ?? '');
export default defineConfig({
entry: ['src'],
outDir: 'dist',
splitting: false,
sourcemap: true,
clean: true,
minify: true,
format: ['cjs', 'esm'],
define: {
__LICENSE_ENDPOINT_ENCODED__: licenseEndpointEncoded,
__LICENSE_ENDPOINT_XOR_KEY__: licenseEndpointXorKey,
},
onSuccess: async () => {
cpSync('src/utils/translations', 'dist/translations', { recursive: true });
},
loader: {
'.json': 'file',
'.yml': 'file',
},
});