-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
Copy pathrollup.ts
365 lines (363 loc) · 8.75 KB
/
rollup.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
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
import { filepaths } from "@fig/autocomplete-generators";
const completionSpec: Fig.Spec = {
name: "rollup",
description: "Next-generation ES module bundler",
options: [
{
name: ["-c", "--config"],
description:
"Use this config file (if argument is used but value is unspecified, defaults to rollup.config.js)",
args: {
name: "filename",
generators: filepaths({ extensions: ["config.js"] }),
},
},
{
name: ["-d", "--dir"],
args: {
name: "dirname",
description: "Directory for chunks (if absent, prints to stdout)",
template: "folders",
},
},
{
name: ["-e", "--external"],
args: {
name: "ids",
description: "Comma-separate list of module IDs to exclude",
},
},
{
name: ["-f", "--format"],
args: {
name: "format",
description: "Type of output (amd, cjs, es, iife, umd, system)",
suggestions: ["amd", "cjs", "es", "iife", "umd", "system"],
},
},
{
name: ["-g", "--globals"],
args: {
name: "pairs",
description: "Comma-separate list of `moduleID:Global` pairs",
},
},
{
name: ["-h", "--help"],
description: "Show help message",
},
{
name: ["-i", "--input"],
args: {
name: "filename",
description: "Input (alternative to <entry file>)",
template: "filepaths",
},
},
{
name: ["-m", "--sourcemap"],
description: "Generate sourcemap (`-m inline` for inline map)",
},
{
name: ["-n", "--name"],
args: {
name: "name",
description: "Name for UMD export",
},
},
{
name: ["-o", "--file"],
args: {
name: "output",
description: "Single output file (if absent, prints to stdout)",
},
},
{
name: ["-p", "--plugin"],
args: {
name: "plugin",
description: "Use the plugin specified (may be repeated)",
},
},
{
name: ["-v", "--version"],
description: "Show version number",
},
{
name: ["-w", "--watch"],
description: "Watch files in bundle and rebuild on changes",
},
{
name: "--amd.id",
args: {
name: "id",
description: "ID for AMD module (default is anonymous)",
},
},
{
name: "--amd.autoId",
description: "Generate the AMD ID based off the chunk name",
},
{
name: "--amd.basePath",
args: {
name: "prefix",
description: "Path to prepend to auto generated AMD ID",
},
},
{
name: "--amd.define",
args: {
name: "name",
description: "Function to use in place of 'define'",
},
},
{
name: "--assetFileNames",
args: {
name: "pattern",
description: "Name pattern for emitted assets",
},
},
{
name: "--banner",
args: {
name: "text",
description: "Code to insert at top of bundle (outside wrapper)",
},
},
{
name: "--chunkFileNames",
args: {
name: "pattern",
description: "Name pattern for emitted secondary chunks",
},
},
{
name: "--compact",
description: "Minify wrapper code",
},
{
name: "--context",
args: {
name: "variable",
description: "Specify top-level 'this' value",
},
},
{
name: "--entryFileNames",
args: {
name: "pattern",
description: "Name pattern for emitted entry chunks",
},
},
{
name: "--environment",
args: {
name: "values",
description: "Settings passed to config file",
},
},
{
name: "--no-esModule",
description: "Do not add __esmodule property",
},
{
name: "--exports",
args: {
name: "mode",
description: "Specify export mode (auto, default, named, none)",
},
},
{
name: "--extend",
description: "Extend global variable defined by --name",
},
{
name: "--no-externalLiveBindings",
description: "Do not generate code to support live bindings",
},
{
name: "--failAfterWarnings",
description: "Exit with an error if the build produced warnings",
},
{
name: "--footer",
args: {
name: "text",
description: "Code to insert at end of bundle (outside wrapper)",
},
},
{
name: "--no-freeze",
description: "Do not freeze namespace objects",
},
{
name: "--no-hoistTransistiveImports",
description: "Do not hoist transistive imports into entry chunks",
},
{
name: "--no-indent",
description: "Don't indent result",
},
{
name: "--no-interop",
description: "Do not include interop block",
},
{
name: "--inlineDynamicImports",
description: "Create a single bundle when using dynamic imports",
},
{
name: "--intro",
args: {
name: "text",
description: "Code to insert at top of bundle (inside wrapper)",
},
},
{
name: "--minifyInternalImports",
description: "Force or disable minification of internal imports",
},
{
name: "--namespaceToStringTag",
description: "Create proper '.toString' methods for namespaces",
},
{
name: "--noConflict",
description: "Generate a noConflict method for UMD globals",
},
{
name: "--outro",
args: {
name: "text",
description: "Code to insert at end of bundle (inside wrapper)",
},
},
{
name: "--preferConst",
description: "Use 'const' instead of 'var' for exports",
},
{
name: "--no-preserveEntrySignatures",
description: "Avoid facade chunks for entry points",
},
{
name: "--preserveModules",
description: "Preserve module structure",
},
{
name: "--preserveModulesRoot",
description: "Put preserved modules under this path at root level",
},
{
name: "--preserveSymlinks",
description: "Do not follow symlinks when resolving files",
},
{
name: "--no-sanitizeFileName",
description: "Do not replace invalid characters in file names",
},
{
name: "--shimMissingExports",
description: "Create shim variables for missing exports",
},
{
name: "--silent",
description: "Don't print warnings",
},
{
name: "--sourcemapExcludeSources",
description: "Do not include source code in source maps",
},
{
name: "--sourcemapFile",
description: "Specify bundle position for source maps",
args: {
name: "file",
},
},
{
name: "--stdin=ext",
description: "Specify file extension used for stdin input",
},
{
name: "--no-stdin",
description: 'Do not read "-" from stdin',
},
{
name: "--no-strict",
description: "Don't emit '\"use strict\"; in the generated modules",
},
{
name: "--strictDeprecations",
description: "Throw errors for deprecated features",
},
{
name: "--systemNullSetters",
description: "Replace empty SystemJS setters with 'null'",
},
{
name: "--no-treeshake",
description: "Disable tree-shaking optimizations",
},
{
name: "--no-treeshake.annotations",
description: "Ignore pure call annotations",
},
{
name: "--no-treeshake.moduleSideEffects",
description: "Assume modules have no side effects",
},
{
name: "--no-treeshake.propertyReadSideEffects",
description: "Ignore property access side-effects",
},
{
name: "--no-treeshake.tryCatchDeoptimization",
description: "Do not turn off try-catch-tree-shaking",
},
{
name: "--no-treeshake.unknownGlobalSideEffects",
description: "Assume unknown globals do not throw",
},
{
name: "--waitForBuildInput",
description: "Wait for bundle input files",
},
{
name: "--watch.buildDelay",
description: "Throttle watch rebuilds",
args: {
name: "number",
},
},
{
name: "--no-watch.clearScreen",
description: "Do not clear the screen when rebuilding",
},
{
name: "--watch.skipWrite",
description: "Do not write files to disk when watching",
},
{
name: "--watch.exclude",
description: "Exclude files from being watched",
args: {
name: "files",
},
},
{
name: "--watch.include",
description: "Limit watching to specified files",
args: {
name: "files",
},
},
{
name: "--validate",
description: "Validate output",
},
],
};
export default completionSpec;