rollup 2.18.0 → 2.18.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.
package/dist/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.18.0
4
- Mon, 22 Jun 2020 04:16:05 GMT - commit ee6ef99935fbd24a3e30ef05b0b98e4019f983c6
3
+ Rollup.js v2.18.1
4
+ Fri, 26 Jun 2020 19:42:28 GMT - commit 1aeb23b23ef1aafe2edcbfd5c4062dd97186f700
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.18.0
4
- Mon, 22 Jun 2020 04:16:05 GMT - commit ee6ef99935fbd24a3e30ef05b0b98e4019f983c6
3
+ Rollup.js v2.18.1
4
+ Fri, 26 Jun 2020 19:42:28 GMT - commit 1aeb23b23ef1aafe2edcbfd5c4062dd97186f700
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.18.0
4
- Mon, 22 Jun 2020 04:16:05 GMT - commit ee6ef99935fbd24a3e30ef05b0b98e4019f983c6
3
+ Rollup.js v2.18.1
4
+ Fri, 26 Jun 2020 19:42:28 GMT - commit 1aeb23b23ef1aafe2edcbfd5c4062dd97186f700
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -475,17 +475,30 @@ function loadAndRegisterPlugin(inputOptions, pluginText) {
475
475
  plugin = require(pluginText);
476
476
  }
477
477
  catch (ex) {
478
- throw new Error(`Cannot load plugin "${pluginText}"`);
478
+ throw new Error(`Cannot load plugin "${pluginText}": ${ex.message}.`);
479
479
  }
480
480
  }
481
481
  }
482
482
  // some plugins do not use `module.exports` for their entry point,
483
483
  // in which case we try the named default export and the plugin name
484
484
  if (typeof plugin === 'object') {
485
- plugin = plugin.default || plugin[pluginText];
485
+ plugin = plugin.default || plugin[getCamelizedPluginBaseName(pluginText)];
486
+ }
487
+ if (!plugin) {
488
+ 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.`);
486
489
  }
487
490
  inputOptions.plugins.push(typeof plugin === 'function' ? plugin.call(plugin, pluginArg) : plugin);
488
491
  }
492
+ function getCamelizedPluginBaseName(pluginText) {
493
+ var _a;
494
+ return (((_a = pluginText.match(/(@rollup\/plugin-|rollup-plugin-)(.+)$/)) === null || _a === void 0 ? void 0 : _a[2]) || pluginText)
495
+ .split(/[\\/]/)
496
+ .slice(-1)[0]
497
+ .split('.')[0]
498
+ .split('-')
499
+ .map((part, index) => (index === 0 || !part ? part : part[0].toUpperCase() + part.slice(1)))
500
+ .join('');
501
+ }
489
502
 
490
503
  function supportsNativeESM() {
491
504
  return Number(/^v(\d+)/.exec(process.version)[1]) >= 13;
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.18.0
4
- Mon, 22 Jun 2020 04:16:05 GMT - commit ee6ef99935fbd24a3e30ef05b0b98e4019f983c6
3
+ Rollup.js v2.18.1
4
+ Fri, 26 Jun 2020 19:42:28 GMT - commit 1aeb23b23ef1aafe2edcbfd5c4062dd97186f700
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.18.0
4
- Mon, 22 Jun 2020 04:16:05 GMT - commit ee6ef99935fbd24a3e30ef05b0b98e4019f983c6
3
+ Rollup.js v2.18.1
4
+ Fri, 26 Jun 2020 19:42:28 GMT - commit 1aeb23b23ef1aafe2edcbfd5c4062dd97186f700
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -28,7 +28,7 @@ var crypto = require('crypto');
28
28
  var fs = require('fs');
29
29
  var events = require('events');
30
30
 
31
- var version = "2.18.0";
31
+ var version = "2.18.1";
32
32
 
33
33
  function createCommonjsModule(fn, basedir, module) {
34
34
  return module = {
@@ -7342,7 +7342,7 @@ class Import extends NodeBase {
7342
7342
  if (namespaceExportName) {
7343
7343
  const _ = options.compact ? '' : ' ';
7344
7344
  const s = options.compact ? '' : ';';
7345
- code.appendLeft(this.end, `.then(function${_}(n)${_}{${_}return n.${namespaceExportName}${s}${_}})`);
7345
+ code.prependLeft(this.end, `.then(function${_}(n)${_}{${_}return n.${namespaceExportName}${s}${_}})`);
7346
7346
  }
7347
7347
  }
7348
7348
  setExternalResolution(exportMode, resolution) {
@@ -9623,7 +9623,7 @@ class Module {
9623
9623
  return error({
9624
9624
  code: Errors.SYNTHETIC_NAMED_EXPORTS_NEED_DEFAULT,
9625
9625
  id: this.id,
9626
- message: `Modules with 'syntheticNamedExports' need a default export.`
9626
+ message: `Module "${relativeId(this.id)}" that is marked to have "syntheticNamedExports" needs a default export.`
9627
9627
  });
9628
9628
  }
9629
9629
  return this.defaultExport;
@@ -10708,6 +10708,11 @@ class Chunk$1 {
10708
10708
  for (const importer of module.includedDynamicImporters) {
10709
10709
  if (!chunkModules.has(importer)) {
10710
10710
  this.dynamicEntryModules.push(module);
10711
+ // Modules with synthetic exports need an artifical namespace for dynamic imports
10712
+ if (module.syntheticNamedExports) {
10713
+ module.namespace.include();
10714
+ this.exports.add(module.namespace);
10715
+ }
10711
10716
  }
10712
10717
  }
10713
10718
  if (module.implicitlyLoadedAfter.size > 0) {
@@ -10825,6 +10830,8 @@ class Chunk$1 {
10825
10830
  }
10826
10831
  }
10827
10832
  for (const module of this.dynamicEntryModules) {
10833
+ if (module.syntheticNamedExports)
10834
+ continue;
10828
10835
  if (!this.facadeModule && this.canModuleBeFacade(module, exposedVariables)) {
10829
10836
  this.facadeModule = module;
10830
10837
  this.facadeChunkByModule.set(module, this);
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.18.0
4
- Mon, 22 Jun 2020 04:16:05 GMT - commit ee6ef99935fbd24a3e30ef05b0b98e4019f983c6
3
+ Rollup.js v2.18.1
4
+ Fri, 26 Jun 2020 19:42:28 GMT - commit 1aeb23b23ef1aafe2edcbfd5c4062dd97186f700
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.18.0
4
- Mon, 22 Jun 2020 04:16:05 GMT - commit ee6ef99935fbd24a3e30ef05b0b98e4019f983c6
3
+ Rollup.js v2.18.1
4
+ Fri, 26 Jun 2020 19:42:28 GMT - commit 1aeb23b23ef1aafe2edcbfd5c4062dd97186f700
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.18.0",
3
+ "version": "2.18.1",
4
4
  "description": "Next-generation ES module bundler",
5
5
  "main": "dist/rollup.js",
6
6
  "module": "dist/es/rollup.js",
@@ -110,7 +110,7 @@
110
110
  "pretty-ms": "^7.0.0",
111
111
  "require-relative": "^0.8.7",
112
112
  "requirejs": "^2.3.6",
113
- "rollup": "^2.14.0",
113
+ "rollup": "^2.18.0",
114
114
  "rollup-plugin-license": "^2.1.0",
115
115
  "rollup-plugin-string": "^3.0.0",
116
116
  "rollup-plugin-terser": "^6.1.0",