-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsup.config.ts
More file actions
51 lines (50 loc) · 1.08 KB
/
tsup.config.ts
File metadata and controls
51 lines (50 loc) · 1.08 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
import { defineConfig } from 'tsup';
export default defineConfig([
// メインエントリポイント
{
entry: ['src/index.ts'],
format: ['esm', 'cjs'],
dts: true,
sourcemap: true,
outDir: 'dist',
},
// ストリーミング機能
{
entry: { 'stream/encode-stream': 'src/stream/encode-stream.ts' },
format: ['esm', 'cjs'],
dts: true,
sourcemap: true,
outDir: 'dist',
},
// ファクトリ機能
{
entry: { 'factory/encoder': 'src/factory/encoder.ts' },
format: ['esm', 'cjs'],
dts: true,
sourcemap: true,
outDir: 'dist',
},
// ユーティリティ機能
{
entry: { 'utils/can-encode': 'src/utils/can-encode.ts' },
format: ['esm', 'cjs'],
dts: true,
sourcemap: true,
outDir: 'dist',
},
// Worker (IIFE形式)
{
entry: { 'worker': 'src/worker/encoder-worker.ts' },
format: ['iife'],
outExtension() {
return {
js: '.js',
};
},
platform: 'browser',
outDir: 'dist',
name: 'worker',
globalName: 'EncoderWorkerGlobal',
sourcemap: true,
},
]);