rollup 2.56.2 → 2.56.3

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.56.2
4
- Tue, 10 Aug 2021 05:26:43 GMT - commit 2f74020e2c2988e670a2744d4b6c0607ab997e2c
3
+ Rollup.js v2.56.3
4
+ Mon, 23 Aug 2021 05:06:39 GMT - commit c41d17ceedfa6c1d7430da70c6c80d86a91e9434
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.56.2
4
- Tue, 10 Aug 2021 05:26:43 GMT - commit 2f74020e2c2988e670a2744d4b6c0607ab997e2c
3
+ Rollup.js v2.56.3
4
+ Mon, 23 Aug 2021 05:06:39 GMT - commit c41d17ceedfa6c1d7430da70c6c80d86a91e9434
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -13,7 +13,7 @@ import { createHash as createHash$1 } from 'crypto';
13
13
  import fs, { lstatSync, realpathSync, readdirSync } from 'fs';
14
14
  import { EventEmitter } from 'events';
15
15
 
16
- var version$1 = "2.56.2";
16
+ var version$1 = "2.56.3";
17
17
 
18
18
  var charToInteger = {};
19
19
  var chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
@@ -9934,9 +9934,9 @@ class Module {
9934
9934
  code: null,
9935
9935
  get dynamicallyImportedIds() {
9936
9936
  const dynamicallyImportedIds = [];
9937
- for (const { resolution } of module.dynamicImports) {
9938
- if (resolution instanceof Module || resolution instanceof ExternalModule) {
9939
- dynamicallyImportedIds.push(resolution.id);
9937
+ for (const { id } of module.dynamicImports) {
9938
+ if (id) {
9939
+ dynamicallyImportedIds.push(id);
9940
9940
  }
9941
9941
  }
9942
9942
  return dynamicallyImportedIds;
@@ -10409,7 +10409,7 @@ class Module {
10409
10409
  else if (argument instanceof Literal && typeof argument.value === 'string') {
10410
10410
  argument = argument.value;
10411
10411
  }
10412
- this.dynamicImports.push({ argument, node, resolution: null });
10412
+ this.dynamicImports.push({ argument, id: null, node, resolution: null });
10413
10413
  }
10414
10414
  addExport(node) {
10415
10415
  if (node instanceof ExportDefaultDeclaration) {
@@ -19643,11 +19643,8 @@ class ModuleLoader {
19643
19643
  });
19644
19644
  return loadNewModulesPromise;
19645
19645
  }
19646
- async fetchDynamicDependencies(module) {
19647
- const dependencies = await Promise.all(module.dynamicImports.map(async (dynamicImport) => {
19648
- const resolvedId = await this.resolveDynamicImport(module, typeof dynamicImport.argument === 'string'
19649
- ? dynamicImport.argument
19650
- : dynamicImport.argument.esTreeNode, module.id);
19646
+ async fetchDynamicDependencies(module, resolveDynamicImportPromises) {
19647
+ const dependencies = await Promise.all(resolveDynamicImportPromises.map(resolveDynamicImportPromise => resolveDynamicImportPromise.then(async ([dynamicImport, resolvedId]) => {
19651
19648
  if (resolvedId === null)
19652
19649
  return null;
19653
19650
  if (typeof resolvedId === 'string') {
@@ -19655,7 +19652,7 @@ class ModuleLoader {
19655
19652
  return null;
19656
19653
  }
19657
19654
  return (dynamicImport.resolution = await this.fetchResolvedDependency(relativeId(resolvedId.id), module.id, resolvedId));
19658
- }));
19655
+ })));
19659
19656
  for (const dependency of dependencies) {
19660
19657
  if (dependency) {
19661
19658
  module.dynamicDependencies.add(dependency);
@@ -19680,10 +19677,15 @@ class ModuleLoader {
19680
19677
  this.modulesById.set(id, module);
19681
19678
  this.graph.watchFiles[id] = true;
19682
19679
  await this.addModuleSource(id, importer, module);
19683
- await this.pluginDriver.hookParallel('moduleParsed', [module.info]);
19680
+ const resolveStaticDependencyPromises = this.getResolveStaticDependencyPromises(module);
19681
+ const resolveDynamicImportPromises = this.getResolveDynamicImportPromises(module);
19682
+ Promise.all([
19683
+ ...resolveStaticDependencyPromises,
19684
+ ...resolveDynamicImportPromises
19685
+ ]).then(() => this.pluginDriver.hookParallel('moduleParsed', [module.info]));
19684
19686
  await Promise.all([
19685
- this.fetchStaticDependencies(module),
19686
- this.fetchDynamicDependencies(module)
19687
+ this.fetchStaticDependencies(module, resolveStaticDependencyPromises),
19688
+ this.fetchDynamicDependencies(module, resolveDynamicImportPromises)
19687
19689
  ]);
19688
19690
  module.linkImports();
19689
19691
  return module;
@@ -19704,10 +19706,8 @@ class ModuleLoader {
19704
19706
  return this.fetchModule(resolvedId, importer, false);
19705
19707
  }
19706
19708
  }
19707
- async fetchStaticDependencies(module) {
19708
- for (const dependency of await Promise.all(Array.from(module.sources, async (source) => this.fetchResolvedDependency(source, module.id, (module.resolvedIds[source] =
19709
- module.resolvedIds[source] ||
19710
- this.handleResolveId(await this.resolveId(source, module.id, EMPTY_OBJECT), source, module.id)))))) {
19709
+ async fetchStaticDependencies(module, resolveStaticDependencyPromises) {
19710
+ for (const dependency of await Promise.all(resolveStaticDependencyPromises.map(resolveStaticDependencyPromise => resolveStaticDependencyPromise.then(([source, resolvedId]) => this.fetchResolvedDependency(source, module.id, resolvedId))))) {
19711
19711
  module.dependencies.add(dependency);
19712
19712
  dependency.importers.push(module.id);
19713
19713
  }
@@ -19755,6 +19755,25 @@ class ModuleLoader {
19755
19755
  id
19756
19756
  };
19757
19757
  }
19758
+ getResolveDynamicImportPromises(module) {
19759
+ return module.dynamicImports.map(async (dynamicImport) => {
19760
+ const resolvedId = await this.resolveDynamicImport(module, typeof dynamicImport.argument === 'string'
19761
+ ? dynamicImport.argument
19762
+ : dynamicImport.argument.esTreeNode, module.id);
19763
+ if (resolvedId && typeof resolvedId === 'object') {
19764
+ dynamicImport.id = resolvedId.id;
19765
+ }
19766
+ return [dynamicImport, resolvedId];
19767
+ });
19768
+ }
19769
+ getResolveStaticDependencyPromises(module) {
19770
+ return Array.from(module.sources, async (source) => [
19771
+ source,
19772
+ (module.resolvedIds[source] =
19773
+ module.resolvedIds[source] ||
19774
+ this.handleResolveId(await this.resolveId(source, module.id, EMPTY_OBJECT), source, module.id))
19775
+ ]);
19776
+ }
19758
19777
  handleResolveId(resolvedId, source, importer) {
19759
19778
  if (resolvedId === null) {
19760
19779
  if (isRelative(source)) {
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.56.2
4
- Tue, 10 Aug 2021 05:26:43 GMT - commit 2f74020e2c2988e670a2744d4b6c0607ab997e2c
3
+ Rollup.js v2.56.3
4
+ Mon, 23 Aug 2021 05:06:39 GMT - commit c41d17ceedfa6c1d7430da70c6c80d86a91e9434
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.56.2
4
- Tue, 10 Aug 2021 05:26:43 GMT - commit 2f74020e2c2988e670a2744d4b6c0607ab997e2c
3
+ Rollup.js v2.56.3
4
+ Mon, 23 Aug 2021 05:06:39 GMT - commit c41d17ceedfa6c1d7430da70c6c80d86a91e9434
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup