rollup 2.52.8 → 2.53.0

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.
package/dist/es/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.52.8
4
- Wed, 07 Jul 2021 04:39:13 GMT - commit b3d5f7d02d2ac1597801c23e10f10651b158f3c4
3
+ Rollup.js v2.53.0
4
+ Fri, 09 Jul 2021 04:29:13 GMT - commit 7435d3121ed138a3c335a6c95b07750803af935f
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.52.8
4
- Wed, 07 Jul 2021 04:39:13 GMT - commit b3d5f7d02d2ac1597801c23e10f10651b158f3c4
3
+ Rollup.js v2.53.0
4
+ Fri, 09 Jul 2021 04:29:13 GMT - commit 7435d3121ed138a3c335a6c95b07750803af935f
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -10,11 +10,10 @@
10
10
  */
11
11
  import { relative as relative$1, resolve, extname, basename, dirname } from 'path';
12
12
  import { createHash as createHash$1 } from 'crypto';
13
- import * as fs from 'fs';
14
- import { lstatSync, realpathSync, readdirSync } from 'fs';
13
+ import fs, { lstatSync, realpathSync, readdirSync } from 'fs';
15
14
  import { EventEmitter } from 'events';
16
15
 
17
- var version$1 = "2.52.8";
16
+ var version$1 = "2.53.0";
18
17
 
19
18
  var charToInteger = {};
20
19
  var chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
@@ -19102,6 +19101,37 @@ function writeFile(dest, data) {
19102
19101
  });
19103
19102
  }
19104
19103
 
19104
+ class Queue {
19105
+ constructor(maxParallel = 1) {
19106
+ this.maxParallel = maxParallel;
19107
+ this.queue = new Array();
19108
+ this.workerCount = 0;
19109
+ }
19110
+ run(task) {
19111
+ return new Promise((resolve, reject) => {
19112
+ this.queue.push({ reject, resolve, task });
19113
+ this.work();
19114
+ });
19115
+ }
19116
+ async work() {
19117
+ if (this.workerCount >= this.maxParallel)
19118
+ return;
19119
+ this.workerCount++;
19120
+ let entry;
19121
+ while ((entry = this.queue.shift())) {
19122
+ const { reject, resolve, task } = entry;
19123
+ try {
19124
+ const result = await task();
19125
+ resolve(result);
19126
+ }
19127
+ catch (err) {
19128
+ reject(err);
19129
+ }
19130
+ }
19131
+ this.workerCount--;
19132
+ }
19133
+ }
19134
+
19105
19135
  function resolveIdViaPlugins(source, importer, pluginDriver, moduleLoaderResolveId, skip, customOptions) {
19106
19136
  let skipped = null;
19107
19137
  let replaceContext = null;
@@ -19421,6 +19451,7 @@ class ModuleLoader {
19421
19451
  this.indexedEntryModules = [];
19422
19452
  this.latestLoadModulesPromise = Promise.resolve();
19423
19453
  this.nextEntryModuleIndex = 0;
19454
+ this.readQueue = new Queue();
19424
19455
  this.resolveId = async (source, importer, customOptions, skip = null) => {
19425
19456
  return this.addDefaultsToResolvedId(this.getNormalizedResolvedIdWithoutDefaults(this.options.external(source, importer, false)
19426
19457
  ? false
@@ -19429,6 +19460,7 @@ class ModuleLoader {
19429
19460
  this.hasModuleSideEffects = options.treeshake
19430
19461
  ? options.treeshake.moduleSideEffects
19431
19462
  : () => true;
19463
+ this.readQueue.maxParallel = options.maxParallelFileReads;
19432
19464
  }
19433
19465
  async addAdditionalModules(unresolvedModules) {
19434
19466
  const result = this.extendLoadModulesPromise(Promise.all(unresolvedModules.map(id => this.loadEntryModule(id, false, undefined, null))));
@@ -19514,7 +19546,8 @@ class ModuleLoader {
19514
19546
  timeStart('load modules', 3);
19515
19547
  let source;
19516
19548
  try {
19517
- source = (_a = (await this.pluginDriver.hookFirst('load', [id]))) !== null && _a !== void 0 ? _a : (await readFile(id));
19549
+ source =
19550
+ (_a = (await this.pluginDriver.hookFirst('load', [id]))) !== null && _a !== void 0 ? _a : (await this.readQueue.run(async () => readFile(id)));
19518
19551
  }
19519
19552
  catch (err) {
19520
19553
  timeEnd('load modules', 3);
@@ -20355,6 +20388,7 @@ function normalizeInputOptions(config) {
20355
20388
  input: getInput(config),
20356
20389
  makeAbsoluteExternalsRelative: (_c = config.makeAbsoluteExternalsRelative) !== null && _c !== void 0 ? _c : true,
20357
20390
  manualChunks: getManualChunks$1(config, onwarn, strictDeprecations),
20391
+ maxParallelFileReads: getMaxParallelFileReads(config),
20358
20392
  moduleContext: getModuleContext(config, context),
20359
20393
  onwarn,
20360
20394
  perf: config.perf || false,
@@ -20435,6 +20469,15 @@ const getManualChunks$1 = (config, warn, strictDeprecations) => {
20435
20469
  }
20436
20470
  return configManualChunks;
20437
20471
  };
20472
+ const getMaxParallelFileReads = (config) => {
20473
+ const maxParallelFileReads = config.maxParallelFileReads;
20474
+ if (typeof maxParallelFileReads === 'number') {
20475
+ if (maxParallelFileReads <= 0)
20476
+ return Infinity;
20477
+ return maxParallelFileReads;
20478
+ }
20479
+ return 20;
20480
+ };
20438
20481
  const getModuleContext = (config, context) => {
20439
20482
  const configModuleContext = config.moduleContext;
20440
20483
  if (typeof configModuleContext === 'function') {
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.52.8
4
- Wed, 07 Jul 2021 04:39:13 GMT - commit b3d5f7d02d2ac1597801c23e10f10651b158f3c4
3
+ Rollup.js v2.53.0
4
+ Fri, 09 Jul 2021 04:29:13 GMT - commit 7435d3121ed138a3c335a6c95b07750803af935f
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -14,7 +14,7 @@ import require$$0$2 from 'util';
14
14
  import { defaultOnWarn, ensureArray as ensureArray$1, warnUnknownOptions, treeshakePresets, error, errInvalidOption, printQuotedStringList, fseventsImporter, rollupInternal } from './rollup.js';
15
15
  import require$$2, { platform } from 'os';
16
16
  import require$$0$3 from 'events';
17
- import fs__default from 'fs';
17
+ import fs$4 from 'fs';
18
18
  import require$$1 from 'stream';
19
19
  import 'crypto';
20
20
 
@@ -4083,6 +4083,7 @@ function mergeInputOptions(config, overrides, defaultOnWarnHandler) {
4083
4083
  input: getOption('input') || [],
4084
4084
  makeAbsoluteExternalsRelative: getOption('makeAbsoluteExternalsRelative'),
4085
4085
  manualChunks: getOption('manualChunks'),
4086
+ maxParallelFileReads: getOption('maxParallelFileReads'),
4086
4087
  moduleContext: getOption('moduleContext'),
4087
4088
  onwarn: getOnWarn(config, defaultOnWarnHandler),
4088
4089
  perf: getOption('perf'),
@@ -4186,7 +4187,7 @@ function mergeOutputOptions(config, overrides, warn) {
4186
4187
 
4187
4188
  var chokidar = {};
4188
4189
 
4189
- const fs$3 = fs__default;
4190
+ const fs$3 = fs$4;
4190
4191
  const { Readable } = require$$1;
4191
4192
  const sysPath$3 = require$$0__default;
4192
4193
  const { promisify: promisify$3 } = require$$0$2;
@@ -5063,7 +5064,7 @@ exports.isLinux = platform === 'linux';
5063
5064
  exports.isIBMi = os.type() === 'OS400';
5064
5065
  }(constants));
5065
5066
 
5066
- const fs$2 = fs__default;
5067
+ const fs$2 = fs$4;
5067
5068
  const sysPath$2 = require$$0__default;
5068
5069
  const { promisify: promisify$2 } = require$$0$2;
5069
5070
  const isBinaryPath = isBinaryPath$1;
@@ -5702,7 +5703,7 @@ var fseventsHandler = {exports: {}};
5702
5703
 
5703
5704
  var require$$3 = /*@__PURE__*/getAugmentedNamespace(fseventsImporter);
5704
5705
 
5705
- const fs$1 = fs__default;
5706
+ const fs$1 = fs$4;
5706
5707
  const sysPath$1 = require$$0__default;
5707
5708
  const { promisify: promisify$1 } = require$$0$2;
5708
5709
 
@@ -6226,7 +6227,7 @@ fseventsHandler.exports = FsEventsHandler$1;
6226
6227
  fseventsHandler.exports.canUse = canUse;
6227
6228
 
6228
6229
  const { EventEmitter } = require$$0$3;
6229
- const fs = fs__default;
6230
+ const fs = fs$4;
6230
6231
  const sysPath = require$$0__default;
6231
6232
  const { promisify } = require$$0$2;
6232
6233
  const readdirp = readdirp_1;
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.52.8
4
- Wed, 07 Jul 2021 04:39:13 GMT - commit b3d5f7d02d2ac1597801c23e10f10651b158f3c4
3
+ Rollup.js v2.53.0
4
+ Fri, 09 Jul 2021 04:29:13 GMT - commit 7435d3121ed138a3c335a6c95b07750803af935f
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup