-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtsup.config.ts
61 lines (58 loc) · 1.65 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
import * as dotenv from 'dotenv';
import { replace } from 'esbuild-plugin-replace';
import { defineConfig } from 'tsup';
import json from './package.json';
dotenv.config();
const isProduction = process.env.NODE_ENV === 'production';
export default defineConfig({
platform: 'browser',
entry: ['src/**/*.ts'],
entryPoints: ['src/index.ts'],
format: ['esm', 'cjs'],
splitting: true,
treeshake: isProduction,
minify: isProduction,
skipNodeModulesBundle: true,
clean: true,
dts: true,
sourcemap: !isProduction,
target: 'es2020',
noExternal: [
'lit',
'lit-element/lit-element.js',
'lit-html',
'@lit/reactive-element',
'@lit-labs/react',
'@lit-labs/observers',
'@lit/task',
'@lit/localize',
'js-base64',
'url-parse',
'requires-port',
'querystringify',
'media-chrome',
'hls.js',
'phoenix',
'tus-js-client',
'@lottiefiles/lottie-player',
'@maveio/metrics',
],
esbuildPlugins: [
replace({
__buildVersion: json.version,
__MAVE_ENDPOINT__: isProduction
? 'https://mave.io/api/v1'
: process.env.MAVE_ENDPOINT,
__MAVE_SOCKET_ENDPOINT__: isProduction
? 'wss://app.mave.io/api/v1/socket'
: process.env.MAVE_SOCKET_ENDPOINT,
__MAVE_UPLOAD_ENDPOINT__: isProduction
? 'https://upload.mave.io/files'
: process.env.MAVE_UPLOAD_ENDPOINT,
__MAVE_METRICS_SOCKET_ENDPOINT__: isProduction
? 'wss://metrics.video-dns.com/socket'
: process.env.MAVE_METRICS_SOCKET_ENDPOINT,
__MAVE_CDN_ENDPOINT__: isProduction ? 'https://space-${this.spaceId}.video-dns.com' : process.env.MAVE_CDN_ENDPOINT,
}),
],
});