-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
98 lines (89 loc) · 2.16 KB
/
rollup.config.js
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
////// Rollup Configuration
const builds = require('./tools/build/rollup-builds');
module.exports = [
//// CJS NODE -- NO MIN builds INTENTIONALLY (Node doesn't need this optimization)
//// and no 'slim' builds because that results in external imports to lodash-es
//// which is ESM-only and incompatible with CJS
// Prod, self-contained
builds.getCjsConfig({
isMin: false,
isSlim: false,
isDev: false,
target: 'node',
}),
// Dev, self-contained
builds.getCjsConfig({
isMin: false,
isSlim: false,
isDev: true,
target: 'node',
}),
//// ESM NODE -- NO MIN builds INTENTIONALLY (Node doesn't need this optimization)
// Prod, self-contained
builds.getEsmConfig({
isMin: false,
isSlim: false,
isDev: false,
target: 'node',
}),
// Prod, externals
builds.getEsmConfig({
isMin: false,
isSlim: true,
isDev: false,
target: 'node',
}),
// Dev, self-contained
builds.getEsmConfig({
isMin: false,
isSlim: false,
isDev: true,
target: 'node',
}),
// Dev, externals
builds.getEsmConfig({
isMin: false,
isSlim: true,
isDev: true,
target: 'node',
}),
//// ESM BROWSER PROD -- Only Prod builds should be minified
// Prod, self-contained -- bundler
builds.getEsmConfig({
isMin: false,
isSlim: false,
isDev: false,
target: 'browser',
}),
// Prod, externals -- bundler
builds.getEsmConfig({
isMin: false,
isSlim: true,
isDev: false,
target: 'browser',
}),
// Prod, self-contained, minified -- in-browser
builds.getEsmConfig({
isMin: true,
isSlim: false,
isDev: false,
target: 'browser',
}),
// NOTE: Prod with externals and minified (i.e. slim/minified) for use in-browser doesn't
// make sense because it'll have export imports that won't be resolvable
//// ESM BROWSER DEV -- No minification
// Dev, self-contained -- bundler or in-browser
builds.getEsmConfig({
isMin: false,
isSlim: false,
isDev: true,
target: 'browser',
}),
// Dev, externals -- bundler or in-browser
builds.getEsmConfig({
isMin: false,
isSlim: true,
isDev: true,
target: 'browser',
}),
];