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/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
@@ -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
@@ -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
@@ -19,7 +19,7 @@ function _interopNamespaceDefaultOnly(e) {
19
19
  return {__proto__: null, 'default': e};
20
20
  }
21
21
 
22
- var version$1 = "2.56.2";
22
+ var version$1 = "2.56.3";
23
23
 
24
24
  function ensureArray(items) {
25
25
  if (Array.isArray(items)) {
@@ -10016,9 +10016,9 @@ class Module {
10016
10016
  code: null,
10017
10017
  get dynamicallyImportedIds() {
10018
10018
  const dynamicallyImportedIds = [];
10019
- for (const { resolution } of module.dynamicImports) {
10020
- if (resolution instanceof Module || resolution instanceof ExternalModule) {
10021
- dynamicallyImportedIds.push(resolution.id);
10019
+ for (const { id } of module.dynamicImports) {
10020
+ if (id) {
10021
+ dynamicallyImportedIds.push(id);
10022
10022
  }
10023
10023
  }
10024
10024
  return dynamicallyImportedIds;
@@ -10491,7 +10491,7 @@ class Module {
10491
10491
  else if (argument instanceof Literal && typeof argument.value === 'string') {
10492
10492
  argument = argument.value;
10493
10493
  }
10494
- this.dynamicImports.push({ argument, node, resolution: null });
10494
+ this.dynamicImports.push({ argument, id: null, node, resolution: null });
10495
10495
  }
10496
10496
  addExport(node) {
10497
10497
  if (node instanceof ExportDefaultDeclaration) {
@@ -19725,11 +19725,8 @@ class ModuleLoader {
19725
19725
  });
19726
19726
  return loadNewModulesPromise;
19727
19727
  }
19728
- async fetchDynamicDependencies(module) {
19729
- const dependencies = await Promise.all(module.dynamicImports.map(async (dynamicImport) => {
19730
- const resolvedId = await this.resolveDynamicImport(module, typeof dynamicImport.argument === 'string'
19731
- ? dynamicImport.argument
19732
- : dynamicImport.argument.esTreeNode, module.id);
19728
+ async fetchDynamicDependencies(module, resolveDynamicImportPromises) {
19729
+ const dependencies = await Promise.all(resolveDynamicImportPromises.map(resolveDynamicImportPromise => resolveDynamicImportPromise.then(async ([dynamicImport, resolvedId]) => {
19733
19730
  if (resolvedId === null)
19734
19731
  return null;
19735
19732
  if (typeof resolvedId === 'string') {
@@ -19737,7 +19734,7 @@ class ModuleLoader {
19737
19734
  return null;
19738
19735
  }
19739
19736
  return (dynamicImport.resolution = await this.fetchResolvedDependency(relativeId(resolvedId.id), module.id, resolvedId));
19740
- }));
19737
+ })));
19741
19738
  for (const dependency of dependencies) {
19742
19739
  if (dependency) {
19743
19740
  module.dynamicDependencies.add(dependency);
@@ -19762,10 +19759,15 @@ class ModuleLoader {
19762
19759
  this.modulesById.set(id, module);
19763
19760
  this.graph.watchFiles[id] = true;
19764
19761
  await this.addModuleSource(id, importer, module);
19765
- await this.pluginDriver.hookParallel('moduleParsed', [module.info]);
19762
+ const resolveStaticDependencyPromises = this.getResolveStaticDependencyPromises(module);
19763
+ const resolveDynamicImportPromises = this.getResolveDynamicImportPromises(module);
19764
+ Promise.all([
19765
+ ...resolveStaticDependencyPromises,
19766
+ ...resolveDynamicImportPromises
19767
+ ]).then(() => this.pluginDriver.hookParallel('moduleParsed', [module.info]));
19766
19768
  await Promise.all([
19767
- this.fetchStaticDependencies(module),
19768
- this.fetchDynamicDependencies(module)
19769
+ this.fetchStaticDependencies(module, resolveStaticDependencyPromises),
19770
+ this.fetchDynamicDependencies(module, resolveDynamicImportPromises)
19769
19771
  ]);
19770
19772
  module.linkImports();
19771
19773
  return module;
@@ -19786,10 +19788,8 @@ class ModuleLoader {
19786
19788
  return this.fetchModule(resolvedId, importer, false);
19787
19789
  }
19788
19790
  }
19789
- async fetchStaticDependencies(module) {
19790
- for (const dependency of await Promise.all(Array.from(module.sources, async (source) => this.fetchResolvedDependency(source, module.id, (module.resolvedIds[source] =
19791
- module.resolvedIds[source] ||
19792
- this.handleResolveId(await this.resolveId(source, module.id, EMPTY_OBJECT), source, module.id)))))) {
19791
+ async fetchStaticDependencies(module, resolveStaticDependencyPromises) {
19792
+ for (const dependency of await Promise.all(resolveStaticDependencyPromises.map(resolveStaticDependencyPromise => resolveStaticDependencyPromise.then(([source, resolvedId]) => this.fetchResolvedDependency(source, module.id, resolvedId))))) {
19793
19793
  module.dependencies.add(dependency);
19794
19794
  dependency.importers.push(module.id);
19795
19795
  }
@@ -19837,6 +19837,25 @@ class ModuleLoader {
19837
19837
  id
19838
19838
  };
19839
19839
  }
19840
+ getResolveDynamicImportPromises(module) {
19841
+ return module.dynamicImports.map(async (dynamicImport) => {
19842
+ const resolvedId = await this.resolveDynamicImport(module, typeof dynamicImport.argument === 'string'
19843
+ ? dynamicImport.argument
19844
+ : dynamicImport.argument.esTreeNode, module.id);
19845
+ if (resolvedId && typeof resolvedId === 'object') {
19846
+ dynamicImport.id = resolvedId.id;
19847
+ }
19848
+ return [dynamicImport, resolvedId];
19849
+ });
19850
+ }
19851
+ getResolveStaticDependencyPromises(module) {
19852
+ return Array.from(module.sources, async (source) => [
19853
+ source,
19854
+ (module.resolvedIds[source] =
19855
+ module.resolvedIds[source] ||
19856
+ this.handleResolveId(await this.resolveId(source, module.id, EMPTY_OBJECT), source, module.id))
19857
+ ]);
19858
+ }
19840
19859
  handleResolveId(resolvedId, source, importer) {
19841
19860
  if (resolvedId === null) {
19842
19861
  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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rollup",
3
- "version": "2.56.2",
3
+ "version": "2.56.3",
4
4
  "description": "Next-generation ES module bundler",
5
5
  "main": "dist/rollup.js",
6
6
  "module": "dist/es/rollup.js",
@@ -16,9 +16,9 @@
16
16
  "ci:test": "npm run build:cjs && npm run build:bootstrap && npm run test:all",
17
17
  "ci:test:only": "npm run build:cjs && npm run build:bootstrap && npm run test:only",
18
18
  "ci:coverage": "npm run build:cjs && npm run build:bootstrap && nyc --reporter lcovonly mocha",
19
- "lint": "npx eslint . --fix --cache && npm run lint:markdown",
20
- "lint:nofix": "npx eslint . && npm run lint:markdown",
21
- "lint:markdown": "markdownlint --config markdownlint.json docs/**/*.md",
19
+ "lint": "eslint . --fix --cache && prettier --write \"**/*.md\"",
20
+ "lint:nofix": "eslint . && prettier --check \"**/*.md\"",
21
+ "lint:markdown": "prettier --write \"**/*.md\"",
22
22
  "perf": "npm run build:cjs && node --expose-gc scripts/perf.js",
23
23
  "perf:debug": "node --inspect-brk scripts/perf-debug.js",
24
24
  "perf:init": "node scripts/perf-init.js",
@@ -93,7 +93,6 @@
93
93
  "lint-staged": "^10.5.4",
94
94
  "locate-character": "^2.0.5",
95
95
  "magic-string": "^0.25.7",
96
- "markdownlint-cli": "^0.27.1",
97
96
  "micromatch": "^4.0.4",
98
97
  "mocha": "^8.4.0",
99
98
  "nyc": "^15.1.0",