rollup 3.1.0 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.1.0
4
- Wed, 12 Oct 2022 08:54:50 GMT - commit f7b768992209a970c240799cdff12a4fa437c0d4
3
+ Rollup.js v3.2.1
4
+ Sun, 16 Oct 2022 04:44:52 GMT - commit 46e1eaaaf05e0c2efa0ed395d7a3cfa99ef25fb5
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -11,165 +11,9 @@
11
11
 
12
12
  const node_fs = require('node:fs');
13
13
  const node_path = require('node:path');
14
- const process$1 = require('node:process');
14
+ const process = require('node:process');
15
15
  const node_url = require('node:url');
16
- const tty = require('tty');
17
16
  const rollup = require('./rollup.js');
18
- const mergeOptions = require('./mergeOptions.js');
19
-
20
- function _interopNamespaceDefault(e) {
21
- const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
22
- if (e) {
23
- for (const k in e) {
24
- n[k] = e[k];
25
- }
26
- }
27
- n.default = e;
28
- return n;
29
- }
30
-
31
- const tty__namespace = /*#__PURE__*/_interopNamespaceDefault(tty);
32
-
33
- const {
34
- env = {},
35
- argv = [],
36
- platform = "",
37
- } = typeof process === "undefined" ? {} : process;
38
-
39
- const isDisabled = "NO_COLOR" in env || argv.includes("--no-color");
40
- const isForced = "FORCE_COLOR" in env || argv.includes("--color");
41
- const isWindows = platform === "win32";
42
- const isDumbTerminal = env.TERM === "dumb";
43
-
44
- const isCompatibleTerminal =
45
- tty__namespace && tty__namespace.isatty && tty__namespace.isatty(1) && env.TERM && !isDumbTerminal;
46
-
47
- const isCI =
48
- "CI" in env &&
49
- ("GITHUB_ACTIONS" in env || "GITLAB_CI" in env || "CIRCLECI" in env);
50
-
51
- const isColorSupported =
52
- !isDisabled &&
53
- (isForced || (isWindows && !isDumbTerminal) || isCompatibleTerminal || isCI);
54
-
55
- const replaceClose = (
56
- index,
57
- string,
58
- close,
59
- replace,
60
- head = string.substring(0, index) + replace,
61
- tail = string.substring(index + close.length),
62
- next = tail.indexOf(close)
63
- ) => head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
64
-
65
- const clearBleed = (index, string, open, close, replace) =>
66
- index < 0
67
- ? open + string + close
68
- : open + replaceClose(index, string, close, replace) + close;
69
-
70
- const filterEmpty =
71
- (open, close, replace = open, at = open.length + 1) =>
72
- (string) =>
73
- string || !(string === "" || string === undefined)
74
- ? clearBleed(
75
- ("" + string).indexOf(close, at),
76
- string,
77
- open,
78
- close,
79
- replace
80
- )
81
- : "";
82
-
83
- const init = (open, close, replace) =>
84
- filterEmpty(`\x1b[${open}m`, `\x1b[${close}m`, replace);
85
-
86
- const colors = {
87
- reset: init(0, 0),
88
- bold: init(1, 22, "\x1b[22m\x1b[1m"),
89
- dim: init(2, 22, "\x1b[22m\x1b[2m"),
90
- italic: init(3, 23),
91
- underline: init(4, 24),
92
- inverse: init(7, 27),
93
- hidden: init(8, 28),
94
- strikethrough: init(9, 29),
95
- black: init(30, 39),
96
- red: init(31, 39),
97
- green: init(32, 39),
98
- yellow: init(33, 39),
99
- blue: init(34, 39),
100
- magenta: init(35, 39),
101
- cyan: init(36, 39),
102
- white: init(37, 39),
103
- gray: init(90, 39),
104
- bgBlack: init(40, 49),
105
- bgRed: init(41, 49),
106
- bgGreen: init(42, 49),
107
- bgYellow: init(43, 49),
108
- bgBlue: init(44, 49),
109
- bgMagenta: init(45, 49),
110
- bgCyan: init(46, 49),
111
- bgWhite: init(47, 49),
112
- blackBright: init(90, 39),
113
- redBright: init(91, 39),
114
- greenBright: init(92, 39),
115
- yellowBright: init(93, 39),
116
- blueBright: init(94, 39),
117
- magentaBright: init(95, 39),
118
- cyanBright: init(96, 39),
119
- whiteBright: init(97, 39),
120
- bgBlackBright: init(100, 49),
121
- bgRedBright: init(101, 49),
122
- bgGreenBright: init(102, 49),
123
- bgYellowBright: init(103, 49),
124
- bgBlueBright: init(104, 49),
125
- bgMagentaBright: init(105, 49),
126
- bgCyanBright: init(106, 49),
127
- bgWhiteBright: init(107, 49),
128
- };
129
-
130
- const createColors = ({ useColor = isColorSupported } = {}) =>
131
- useColor
132
- ? colors
133
- : Object.keys(colors).reduce(
134
- (colors, key) => ({ ...colors, [key]: String }),
135
- {}
136
- );
137
-
138
- createColors();
139
-
140
- // @see https://no-color.org
141
- // @see https://www.npmjs.com/package/chalk
142
- const { bold, cyan, dim, gray, green, red, underline, yellow } = createColors({
143
- useColor: process$1.env.FORCE_COLOR !== '0' && !process$1.env.NO_COLOR
144
- });
145
-
146
- // log to stderr to keep `rollup main.js > bundle.js` from breaking
147
- const stderr = (...args) => process$1.stderr.write(`${args.join('')}\n`);
148
- function handleError(err, recover = false) {
149
- const name = err.name || err.cause?.name;
150
- const nameSection = name ? `${name}: ` : '';
151
- const pluginSection = err.plugin ? `(plugin ${err.plugin}) ` : '';
152
- const message = `${pluginSection}${nameSection}${err.message}`;
153
- stderr(bold(red(`[!] ${bold(message.toString())}`)));
154
- if (err.url) {
155
- stderr(cyan(err.url));
156
- }
157
- if (err.loc) {
158
- stderr(`${rollup.relativeId((err.loc.file || err.id))} (${err.loc.line}:${err.loc.column})`);
159
- }
160
- else if (err.id) {
161
- stderr(rollup.relativeId(err.id));
162
- }
163
- if (err.frame) {
164
- stderr(dim(err.frame));
165
- }
166
- if (err.stack) {
167
- stderr(dim(err.stack));
168
- }
169
- stderr('');
170
- if (!recover)
171
- process$1.exit(1);
172
- }
173
17
 
174
18
  function batchWarnings() {
175
19
  let count = 0;
@@ -194,7 +38,7 @@ function batchWarnings() {
194
38
  const loc = warning.loc
195
39
  ? `${rollup.relativeId(id)} (${warning.loc.line}:${warning.loc.column})`
196
40
  : rollup.relativeId(id);
197
- stderr(bold(rollup.relativeId(loc)));
41
+ rollup.stderr(rollup.bold(rollup.relativeId(loc)));
198
42
  }
199
43
  if (warning.frame)
200
44
  info(warning.frame);
@@ -206,7 +50,7 @@ function batchWarnings() {
206
50
  flush() {
207
51
  if (count === 0)
208
52
  return;
209
- const codes = Array.from(deferredWarnings.keys()).sort((a, b) => deferredWarnings.get(b).length - deferredWarnings.get(a).length);
53
+ const codes = [...deferredWarnings.keys()].sort((a, b) => deferredWarnings.get(b).length - deferredWarnings.get(a).length);
210
54
  for (const code of codes) {
211
55
  deferredHandlers[code](deferredWarnings.get(code));
212
56
  }
@@ -221,11 +65,11 @@ function batchWarnings() {
221
65
  const immediateHandlers = {
222
66
  MISSING_NODE_BUILTINS(warning) {
223
67
  title(`Missing shims for Node.js built-ins`);
224
- stderr(`Creating a browser bundle that depends on ${rollup.printQuotedStringList(warning.ids)}. You might need to include https://github.com/FredKSchott/rollup-plugin-polyfill-node`);
68
+ rollup.stderr(`Creating a browser bundle that depends on ${rollup.printQuotedStringList(warning.ids)}. You might need to include https://github.com/FredKSchott/rollup-plugin-polyfill-node`);
225
69
  },
226
70
  UNKNOWN_OPTION(warning) {
227
71
  title(`You have passed an unrecognized option`);
228
- stderr(warning.message);
72
+ rollup.stderr(warning.message);
229
73
  }
230
74
  };
231
75
  const deferredHandlers = {
@@ -233,15 +77,15 @@ const deferredHandlers = {
233
77
  title(`Circular dependenc${warnings.length > 1 ? 'ies' : 'y'}`);
234
78
  const displayed = warnings.length > 5 ? warnings.slice(0, 3) : warnings;
235
79
  for (const warning of displayed) {
236
- stderr(warning.ids.map(rollup.relativeId).join(' -> '));
80
+ rollup.stderr(warning.ids.map(rollup.relativeId).join(' -> '));
237
81
  }
238
82
  if (warnings.length > displayed.length) {
239
- stderr(`...and ${warnings.length - displayed.length} more`);
83
+ rollup.stderr(`...and ${warnings.length - displayed.length} more`);
240
84
  }
241
85
  },
242
86
  EMPTY_BUNDLE(warnings) {
243
87
  title(`Generated${warnings.length === 1 ? ' an' : ''} empty ${warnings.length > 1 ? 'chunks' : 'chunk'}`);
244
- stderr(rollup.printQuotedStringList(warnings.map(warning => warning.names[0])));
88
+ rollup.stderr(rollup.printQuotedStringList(warnings.map(warning => warning.names[0])));
245
89
  },
246
90
  EVAL(warnings) {
247
91
  title('Use of eval is strongly discouraged');
@@ -252,37 +96,37 @@ const deferredHandlers = {
252
96
  title('Missing exports');
253
97
  info('https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module');
254
98
  for (const warning of warnings) {
255
- stderr(bold(rollup.relativeId(warning.id)));
256
- stderr(`${warning.binding} is not exported by ${rollup.relativeId(warning.exporter)}`);
257
- stderr(gray(warning.frame));
99
+ rollup.stderr(rollup.bold(rollup.relativeId(warning.id)));
100
+ rollup.stderr(`${warning.binding} is not exported by ${rollup.relativeId(warning.exporter)}`);
101
+ rollup.stderr(rollup.gray(warning.frame));
258
102
  }
259
103
  },
260
104
  MISSING_GLOBAL_NAME(warnings) {
261
105
  title(`Missing global variable ${warnings.length > 1 ? 'names' : 'name'}`);
262
106
  info('https://rollupjs.org/guide/en/#outputglobals');
263
- stderr(`Use "output.globals" to specify browser global variable names corresponding to external modules:`);
107
+ rollup.stderr(`Use "output.globals" to specify browser global variable names corresponding to external modules:`);
264
108
  for (const warning of warnings) {
265
- stderr(`${bold(warning.id)} (guessing "${warning.names[0]}")`);
109
+ rollup.stderr(`${rollup.bold(warning.id)} (guessing "${warning.names[0]}")`);
266
110
  }
267
111
  },
268
112
  MIXED_EXPORTS(warnings) {
269
113
  title('Mixing named and default exports');
270
114
  info(`https://rollupjs.org/guide/en/#outputexports`);
271
- stderr(bold('The following entry modules are using named and default exports together:'));
115
+ rollup.stderr(rollup.bold('The following entry modules are using named and default exports together:'));
272
116
  warnings.sort((a, b) => (a.id < b.id ? -1 : 1));
273
117
  const displayedWarnings = warnings.length > 5 ? warnings.slice(0, 3) : warnings;
274
118
  for (const warning of displayedWarnings) {
275
- stderr(rollup.relativeId(warning.id));
119
+ rollup.stderr(rollup.relativeId(warning.id));
276
120
  }
277
121
  if (displayedWarnings.length < warnings.length) {
278
- stderr(`...and ${warnings.length - displayedWarnings.length} other entry modules`);
122
+ rollup.stderr(`...and ${warnings.length - displayedWarnings.length} other entry modules`);
279
123
  }
280
- stderr(`\nConsumers of your bundle will have to use chunk.default to access their default export, which may not be what you want. Use \`output.exports: "named"\` to disable this warning.`);
124
+ rollup.stderr(`\nConsumers of your bundle will have to use chunk.default to access their default export, which may not be what you want. Use \`output.exports: "named"\` to disable this warning.`);
281
125
  },
282
126
  NAMESPACE_CONFLICT(warnings) {
283
127
  title(`Conflicting re-exports`);
284
128
  for (const warning of warnings) {
285
- stderr(`"${bold(rollup.relativeId(warning.reexporter))}" re-exports "${warning.binding}" from both "${rollup.relativeId(warning.ids[0])}" and "${rollup.relativeId(warning.ids[1])}" (will be ignored).`);
129
+ rollup.stderr(`"${rollup.bold(rollup.relativeId(warning.reexporter))}" re-exports "${warning.binding}" from both "${rollup.relativeId(warning.ids[0])}" and "${rollup.relativeId(warning.ids[1])}" (will be ignored).`);
286
130
  }
287
131
  },
288
132
  PLUGIN_WARNING(warnings) {
@@ -301,7 +145,7 @@ const deferredHandlers = {
301
145
  if (warning.loc) {
302
146
  loc += `: (${warning.loc.line}:${warning.loc.column})`;
303
147
  }
304
- stderr(bold(loc));
148
+ rollup.stderr(rollup.bold(loc));
305
149
  }
306
150
  if (warning.frame)
307
151
  info(warning.frame);
@@ -313,7 +157,7 @@ const deferredHandlers = {
313
157
  title(`Broken sourcemap`);
314
158
  info('https://rollupjs.org/guide/en/#warning-sourcemap-is-likely-to-be-incorrect');
315
159
  const plugins = [...new Set(warnings.map(({ plugin }) => plugin).filter(Boolean))];
316
- stderr(`Plugins that transform code (such as ${rollup.printQuotedStringList(plugins)}) should generate accompanying sourcemaps.`);
160
+ rollup.stderr(`Plugins that transform code (such as ${rollup.printQuotedStringList(plugins)}) should generate accompanying sourcemaps.`);
317
161
  },
318
162
  THIS_IS_UNDEFINED(warnings) {
319
163
  title('"this" has been rewritten to "undefined"');
@@ -328,13 +172,13 @@ const deferredHandlers = {
328
172
  rollup.getOrCreate(dependencies, rollup.relativeId(warning.exporter), () => []).push(rollup.relativeId(warning.id));
329
173
  }
330
174
  for (const [dependency, importers] of dependencies) {
331
- stderr(`${bold(dependency)} (imported by ${rollup.printQuotedStringList(importers)})`);
175
+ rollup.stderr(`${rollup.bold(dependency)} (imported by ${rollup.printQuotedStringList(importers)})`);
332
176
  }
333
177
  },
334
178
  UNUSED_EXTERNAL_IMPORT(warnings) {
335
179
  title('Unused external imports');
336
180
  for (const warning of warnings) {
337
- stderr(warning.names +
181
+ rollup.stderr(warning.names +
338
182
  ' imported from external module "' +
339
183
  warning.exporter +
340
184
  '" but never used in ' +
@@ -343,17 +187,17 @@ const deferredHandlers = {
343
187
  }
344
188
  }
345
189
  };
346
- function title(str) {
347
- stderr(bold(yellow(`(!) ${str}`)));
190
+ function title(string_) {
191
+ rollup.stderr(rollup.bold(rollup.yellow(`(!) ${string_}`)));
348
192
  }
349
193
  function info(url) {
350
- stderr(gray(url));
194
+ rollup.stderr(rollup.gray(url));
351
195
  }
352
- function nest(array, prop) {
196
+ function nest(array, property) {
353
197
  const nested = [];
354
198
  const lookup = new Map();
355
199
  for (const item of array) {
356
- const key = item[prop];
200
+ const key = item[property];
357
201
  rollup.getOrCreate(lookup, key, () => {
358
202
  const items = {
359
203
  items: [],
@@ -369,21 +213,21 @@ function showTruncatedWarnings(warnings) {
369
213
  const nestedByModule = nest(warnings, 'id');
370
214
  const displayedByModule = nestedByModule.length > 5 ? nestedByModule.slice(0, 3) : nestedByModule;
371
215
  for (const { key: id, items } of displayedByModule) {
372
- stderr(bold(rollup.relativeId(id)));
373
- stderr(gray(items[0].frame));
216
+ rollup.stderr(rollup.bold(rollup.relativeId(id)));
217
+ rollup.stderr(rollup.gray(items[0].frame));
374
218
  if (items.length > 1) {
375
- stderr(`...and ${items.length - 1} other ${items.length > 2 ? 'occurrences' : 'occurrence'}`);
219
+ rollup.stderr(`...and ${items.length - 1} other ${items.length > 2 ? 'occurrences' : 'occurrence'}`);
376
220
  }
377
221
  }
378
222
  if (nestedByModule.length > displayedByModule.length) {
379
- stderr(`\n...and ${nestedByModule.length - displayedByModule.length} other files`);
223
+ rollup.stderr(`\n...and ${nestedByModule.length - displayedByModule.length} other files`);
380
224
  }
381
225
  }
382
226
 
383
227
  const stdinName = '-';
384
228
  let stdinResult = null;
385
- function stdinPlugin(arg) {
386
- const suffix = typeof arg == 'string' && arg.length ? '.' + arg : '';
229
+ function stdinPlugin(argument) {
230
+ const suffix = typeof argument == 'string' && argument.length > 0 ? '.' + argument : '';
387
231
  return {
388
232
  load(id) {
389
233
  if (id === stdinName || id.startsWith(stdinName + '.')) {
@@ -401,15 +245,15 @@ function stdinPlugin(arg) {
401
245
  function readStdin() {
402
246
  return new Promise((resolve, reject) => {
403
247
  const chunks = [];
404
- process$1.stdin.setEncoding('utf8');
405
- process$1.stdin
248
+ process.stdin.setEncoding('utf8');
249
+ process.stdin
406
250
  .on('data', chunk => chunks.push(chunk))
407
251
  .on('end', () => {
408
252
  const result = chunks.join('');
409
253
  resolve(result);
410
254
  })
411
- .on('error', err => {
412
- reject(err);
255
+ .on('error', error => {
256
+ reject(error);
413
257
  });
414
258
  });
415
259
  }
@@ -425,7 +269,7 @@ function waitForInputPlugin() {
425
269
  for (const specifier of inputSpecifiers) {
426
270
  if ((await this.resolve(specifier)) === null) {
427
271
  if (lastAwaitedSpecifier !== specifier) {
428
- stderr(`waiting for input ${bold(specifier)}...`);
272
+ rollup.stderr(`waiting for input ${rollup.bold(specifier)}...`);
429
273
  lastAwaitedSpecifier = specifier;
430
274
  }
431
275
  await new Promise(resolve => setTimeout(resolve, 500));
@@ -450,7 +294,7 @@ async function addCommandPluginsToInputOptions(inputOptions, command) {
450
294
  }
451
295
  async function addPluginsFromCommandOption(commandPlugin, inputOptions) {
452
296
  if (commandPlugin) {
453
- const plugins = rollup.normalizePluginOption(commandPlugin);
297
+ const plugins = await rollup.normalizePluginOption(commandPlugin);
454
298
  for (const plugin of plugins) {
455
299
  if (/[={}]/.test(plugin)) {
456
300
  // -p plugin=value
@@ -469,23 +313,23 @@ async function addPluginsFromCommandOption(commandPlugin, inputOptions) {
469
313
  }
470
314
  async function loadAndRegisterPlugin(inputOptions, pluginText) {
471
315
  let plugin = null;
472
- let pluginArg = undefined;
316
+ let pluginArgument = undefined;
473
317
  if (pluginText[0] === '{') {
474
318
  // -p "{transform(c,i){...}}"
475
319
  plugin = new Function('return ' + pluginText);
476
320
  }
477
321
  else {
478
- const match = pluginText.match(/^([@.:/\\\w|^{}-]+)(=(.*))?$/);
322
+ const match = pluginText.match(/^([\w./:@\\^{|}-]+)(=(.*))?$/);
479
323
  if (match) {
480
324
  // -p plugin
481
325
  // -p plugin=arg
482
326
  pluginText = match[1];
483
- pluginArg = new Function('return ' + match[3])();
327
+ pluginArgument = new Function('return ' + match[3])();
484
328
  }
485
329
  else {
486
330
  throw new Error(`Invalid --plugin argument format: ${JSON.stringify(pluginText)}`);
487
331
  }
488
- if (!/^\.|^rollup-plugin-|[@/\\]/.test(pluginText)) {
332
+ if (!/^\.|^rollup-plugin-|[/@\\]/.test(pluginText)) {
489
333
  // Try using plugin prefix variations first if applicable.
490
334
  // Prefix order is significant - left has higher precedence.
491
335
  for (const prefix of ['@rollup/plugin-', 'rollup-plugin-']) {
@@ -504,13 +348,13 @@ async function loadAndRegisterPlugin(inputOptions, pluginText) {
504
348
  pluginText = node_path.resolve(pluginText);
505
349
  // Windows absolute paths must be specified as file:// protocol URL
506
350
  // Note that we do not have coverage for Windows-only code paths
507
- else if (pluginText.match(/^[A-Za-z]:\\/)) {
351
+ else if (/^[A-Za-z]:\\/.test(pluginText)) {
508
352
  pluginText = node_url.pathToFileURL(node_path.resolve(pluginText)).href;
509
353
  }
510
354
  plugin = await requireOrImport(pluginText);
511
355
  }
512
- catch (err) {
513
- throw new Error(`Cannot load plugin "${pluginText}": ${err.message}.`);
356
+ catch (error) {
357
+ throw new Error(`Cannot load plugin "${pluginText}": ${error.message}.`);
514
358
  }
515
359
  }
516
360
  }
@@ -522,11 +366,11 @@ async function loadAndRegisterPlugin(inputOptions, pluginText) {
522
366
  if (!plugin) {
523
367
  throw new Error(`Cannot find entry for plugin "${pluginText}". The plugin needs to export a function either as "default" or "${getCamelizedPluginBaseName(pluginText)}" for Rollup to recognize it.`);
524
368
  }
525
- inputOptions.plugins.push(typeof plugin === 'function' ? plugin.call(plugin, pluginArg) : plugin);
369
+ inputOptions.plugins.push(typeof plugin === 'function' ? plugin.call(plugin, pluginArgument) : plugin);
526
370
  }
527
371
  function getCamelizedPluginBaseName(pluginText) {
528
372
  return (pluginText.match(/(@rollup\/plugin-|rollup-plugin-)(.+)$/)?.[2] || pluginText)
529
- .split(/[\\/]/)
373
+ .split(/[/\\]/)
530
374
  .slice(-1)[0]
531
375
  .split('.')[0]
532
376
  .split('-')
@@ -535,6 +379,7 @@ function getCamelizedPluginBaseName(pluginText) {
535
379
  }
536
380
  async function requireOrImport(pluginPath) {
537
381
  try {
382
+ // eslint-disable-next-line unicorn/prefer-module
538
383
  return require(pluginPath);
539
384
  }
540
385
  catch {
@@ -548,15 +393,15 @@ async function loadConfigFile(fileName, commandOptions = {}) {
548
393
  try {
549
394
  const normalizedConfigs = [];
550
395
  for (const config of configs) {
551
- const options = mergeOptions.mergeOptions(config, commandOptions, warnings.add);
396
+ const options = await rollup.mergeOptions(config, commandOptions, warnings.add);
552
397
  await addCommandPluginsToInputOptions(options, commandOptions);
553
398
  normalizedConfigs.push(options);
554
399
  }
555
400
  return { options: normalizedConfigs, warnings };
556
401
  }
557
- catch (err) {
402
+ catch (error_) {
558
403
  warnings.flush();
559
- throw err;
404
+ throw error_;
560
405
  }
561
406
  }
562
407
  async function getConfigFileExport(fileName, commandOptions) {
@@ -564,11 +409,11 @@ async function getConfigFileExport(fileName, commandOptions) {
564
409
  try {
565
410
  return await loadTranspiledConfigFile(fileName, commandOptions);
566
411
  }
567
- catch (err) {
568
- if (err.message.includes('not defined in ES module scope')) {
569
- return rollup.error(rollup.errCannotBundleConfigAsEsm(err));
412
+ catch (error_) {
413
+ if (error_.message.includes('not defined in ES module scope')) {
414
+ return rollup.error(rollup.errorCannotBundleConfigAsEsm(error_));
570
415
  }
571
- throw err;
416
+ throw error_;
572
417
  }
573
418
  }
574
419
  let cannotLoadEsm = false;
@@ -577,26 +422,26 @@ async function getConfigFileExport(fileName, commandOptions) {
577
422
  cannotLoadEsm = true;
578
423
  }
579
424
  };
580
- process$1.on('warning', handleWarning);
425
+ process.on('warning', handleWarning);
581
426
  try {
582
427
  const fileUrl = node_url.pathToFileURL(fileName);
583
- if (process$1.env.ROLLUP_WATCH) {
428
+ if (process.env.ROLLUP_WATCH) {
584
429
  // We are adding the current date to allow reloads in watch mode
585
430
  fileUrl.search = `?${Date.now()}`;
586
431
  }
587
432
  return (await import(fileUrl.href)).default;
588
433
  }
589
- catch (err) {
434
+ catch (error_) {
590
435
  if (cannotLoadEsm) {
591
- return rollup.error(rollup.errCannotLoadConfigAsCjs(err));
436
+ return rollup.error(rollup.errorCannotLoadConfigAsCjs(error_));
592
437
  }
593
- if (err.message.includes('not defined in ES module scope')) {
594
- return rollup.error(rollup.errCannotLoadConfigAsEsm(err));
438
+ if (error_.message.includes('not defined in ES module scope')) {
439
+ return rollup.error(rollup.errorCannotLoadConfigAsEsm(error_));
595
440
  }
596
- throw err;
441
+ throw error_;
597
442
  }
598
443
  finally {
599
- process$1.off('warning', handleWarning);
444
+ process.off('warning', handleWarning);
600
445
  }
601
446
  }
602
447
  function getDefaultFromCjs(namespace) {
@@ -614,7 +459,7 @@ async function loadTranspiledConfigFile(fileName, { bundleConfigAsCjs, configPlu
614
459
  await addPluginsFromCommandOption(configPlugin, inputOptions);
615
460
  const bundle = await rollup.rollup(inputOptions);
616
461
  if (!silent && warnings.count > 0) {
617
- stderr(bold(`loaded ${rollup.relativeId(fileName)} with warnings`));
462
+ rollup.stderr(rollup.bold(`loaded ${rollup.relativeId(fileName)} with warnings`));
618
463
  warnings.flush();
619
464
  }
620
465
  const { output: [{ code }] } = await bundle.generate({
@@ -651,19 +496,13 @@ async function getConfigList(configFileExport, commandOptions) {
651
496
  ? configFileExport(commandOptions)
652
497
  : configFileExport);
653
498
  if (Object.keys(config).length === 0) {
654
- return rollup.error(rollup.errMissingConfig());
499
+ return rollup.error(rollup.errorMissingConfig());
655
500
  }
656
501
  return Array.isArray(config) ? config : [config];
657
502
  }
658
503
 
659
504
  exports.addCommandPluginsToInputOptions = addCommandPluginsToInputOptions;
660
505
  exports.batchWarnings = batchWarnings;
661
- exports.bold = bold;
662
- exports.cyan = cyan;
663
- exports.green = green;
664
- exports.handleError = handleError;
665
506
  exports.loadConfigFile = loadConfigFile;
666
- exports.stderr = stderr;
667
507
  exports.stdinName = stdinName;
668
- exports.underline = underline;
669
508
  //# sourceMappingURL=loadConfigFile.js.map