-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrolldown.config.js
More file actions
72 lines (71 loc) · 1.86 KB
/
rolldown.config.js
File metadata and controls
72 lines (71 loc) · 1.86 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
66
67
68
69
70
71
72
import { defineConfig } from 'rolldown'
export default defineConfig([
// Main entry (all exports)
{
input: 'src/index.ts',
output: [
{ file: 'dist/index.js', format: 'esm' },
{ file: 'dist/index.cjs', format: 'cjs' },
],
external: ['brotli-lib', 'brotli-lib/decode', 'brotli-lib/encode'],
},
// All decode (woff1 + woff2)
{
input: 'src/decode.ts',
output: [
{ file: 'dist/decode.js', format: 'esm' },
{ file: 'dist/decode.cjs', format: 'cjs' },
],
external: ['brotli-lib', 'brotli-lib/decode'],
},
// All encode (woff1 + woff2)
{
input: 'src/encode.ts',
output: [
{ file: 'dist/encode.js', format: 'esm' },
{ file: 'dist/encode.cjs', format: 'cjs' },
],
external: ['brotli-lib', 'brotli-lib/encode'],
},
// WOFF decode only
{
input: 'src/woff-decode.ts',
output: [
{ file: 'dist/woff-decode.js', format: 'esm' },
{ file: 'dist/woff-decode.cjs', format: 'cjs' },
],
},
// WOFF encode only
{
input: 'src/woff-encode.ts',
output: [
{ file: 'dist/woff-encode.js', format: 'esm' },
{ file: 'dist/woff-encode.cjs', format: 'cjs' },
],
},
// WOFF2 decode only
{
input: 'src/woff2-decode.ts',
output: [
{ file: 'dist/woff2-decode.js', format: 'esm' },
{ file: 'dist/woff2-decode.cjs', format: 'cjs' },
],
external: ['brotli-lib', 'brotli-lib/decode'],
},
// WOFF2 decode UMD (for script tag usage, bundles brotli-lib)
{
input: 'src/woff2-decode.ts',
output: [
{ file: 'dist/woff2-decode.umd.js', format: 'iife', name: 'woffLib' },
],
},
// WOFF2 encode only
{
input: 'src/woff2-encode.ts',
output: [
{ file: 'dist/woff2-encode.js', format: 'esm' },
{ file: 'dist/woff2-encode.cjs', format: 'cjs' },
],
external: ['brotli-lib', 'brotli-lib/encode'],
},
])