rollup 2.57.0 → 2.58.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.57.0
4
- Wed, 22 Sep 2021 04:43:07 GMT - commit b67ef301e8e44f9e0d9b144c0cce441e2a41c3da
3
+ Rollup.js v2.58.0
4
+ Fri, 01 Oct 2021 06:54:03 GMT - commit 3a404a07f41a10d10b7af536f05b90ea46d8ad3d
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.57.0
4
- Wed, 22 Sep 2021 04:43:07 GMT - commit b67ef301e8e44f9e0d9b144c0cce441e2a41c3da
3
+ Rollup.js v2.58.0
4
+ Fri, 01 Oct 2021 06:54:03 GMT - commit 3a404a07f41a10d10b7af536f05b90ea46d8ad3d
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.57.0";
16
+ var version$1 = "2.58.0";
17
17
 
18
18
  var charToInteger = {};
19
19
  var chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
@@ -1440,7 +1440,7 @@ Bundle$1.prototype.trimEnd = function trimEnd (charType) {
1440
1440
  return this;
1441
1441
  };
1442
1442
 
1443
- var MagicString$1 = MagicString;
1443
+ const MagicString$1 = MagicString;
1444
1444
 
1445
1445
  function relative(from, to) {
1446
1446
  const fromParts = from.split(/[/\\]/).filter(Boolean);
@@ -3868,7 +3868,7 @@ var picomatch_1 = picomatch$1;
3868
3868
 
3869
3869
  var picomatch = picomatch_1;
3870
3870
 
3871
- var pm = picomatch;
3871
+ const pm = picomatch;
3872
3872
 
3873
3873
  const extractors = {
3874
3874
  ArrayPattern(names, param) {
@@ -13688,7 +13688,7 @@ function umd(magicString, { accessedGlobals, dependencies, exports, hasExports,
13688
13688
  return magicString.trim().indent(t).append(wrapperOutro).prepend(wrapperIntro);
13689
13689
  }
13690
13690
 
13691
- var finalisers = { amd, cjs, es, iife, system, umd };
13691
+ const finalisers = { amd, cjs, es, iife, system, umd };
13692
13692
 
13693
13693
  class Source {
13694
13694
  constructor(filename, content) {
@@ -21529,7 +21529,7 @@ class Queue {
21529
21529
  }
21530
21530
  }
21531
21531
 
21532
- function resolveIdViaPlugins(source, importer, pluginDriver, moduleLoaderResolveId, skip, customOptions) {
21532
+ function resolveIdViaPlugins(source, importer, pluginDriver, moduleLoaderResolveId, skip, customOptions, isEntry) {
21533
21533
  let skipped = null;
21534
21534
  let replaceContext = null;
21535
21535
  if (skip) {
@@ -21541,16 +21541,16 @@ function resolveIdViaPlugins(source, importer, pluginDriver, moduleLoaderResolve
21541
21541
  }
21542
21542
  replaceContext = (pluginContext, plugin) => ({
21543
21543
  ...pluginContext,
21544
- resolve: (source, importer, { custom, skipSelf } = BLANK) => {
21545
- return moduleLoaderResolveId(source, importer, custom, skipSelf ? [...skip, { importer, plugin, source }] : skip);
21544
+ resolve: (source, importer, { custom, isEntry, skipSelf } = BLANK) => {
21545
+ return moduleLoaderResolveId(source, importer, custom, isEntry, skipSelf ? [...skip, { importer, plugin, source }] : skip);
21546
21546
  }
21547
21547
  });
21548
21548
  }
21549
- return pluginDriver.hookFirst('resolveId', [source, importer, { custom: customOptions }], replaceContext, skipped);
21549
+ return pluginDriver.hookFirst('resolveId', [source, importer, { custom: customOptions, isEntry }], replaceContext, skipped);
21550
21550
  }
21551
21551
 
21552
- async function resolveId(source, importer, preserveSymlinks, pluginDriver, moduleLoaderResolveId, skip, customOptions) {
21553
- const pluginResult = await resolveIdViaPlugins(source, importer, pluginDriver, moduleLoaderResolveId, skip, customOptions);
21552
+ async function resolveId(source, importer, preserveSymlinks, pluginDriver, moduleLoaderResolveId, skip, customOptions, isEntry) {
21553
+ const pluginResult = await resolveIdViaPlugins(source, importer, pluginDriver, moduleLoaderResolveId, skip, customOptions, isEntry);
21554
21554
  if (pluginResult != null)
21555
21555
  return pluginResult;
21556
21556
  // external modules (non-entry modules that start with neither '.' or '/')
@@ -21849,10 +21849,10 @@ class ModuleLoader {
21849
21849
  this.latestLoadModulesPromise = Promise.resolve();
21850
21850
  this.nextEntryModuleIndex = 0;
21851
21851
  this.readQueue = new Queue();
21852
- this.resolveId = async (source, importer, customOptions, skip = null) => {
21852
+ this.resolveId = async (source, importer, customOptions, isEntry, skip = null) => {
21853
21853
  return this.addDefaultsToResolvedId(this.getNormalizedResolvedIdWithoutDefaults(this.options.external(source, importer, false)
21854
21854
  ? false
21855
- : await resolveId(source, importer, this.options.preserveSymlinks, this.pluginDriver, this.resolveId, skip, customOptions), importer, source));
21855
+ : await resolveId(source, importer, this.options.preserveSymlinks, this.pluginDriver, this.resolveId, skip, customOptions, typeof isEntry === 'boolean' ? isEntry : !importer), importer, source));
21856
21856
  };
21857
21857
  this.hasModuleSideEffects = options.treeshake
21858
21858
  ? options.treeshake.moduleSideEffects
@@ -22123,7 +22123,7 @@ class ModuleLoader {
22123
22123
  source,
22124
22124
  (module.resolvedIds[source] =
22125
22125
  module.resolvedIds[source] ||
22126
- this.handleResolveId(await this.resolveId(source, module.id, EMPTY_OBJECT), source, module.id))
22126
+ this.handleResolveId(await this.resolveId(source, module.id, EMPTY_OBJECT, false), source, module.id))
22127
22127
  ]);
22128
22128
  }
22129
22129
  handleResolveId(resolvedId, source, importer) {
@@ -22148,7 +22148,7 @@ class ModuleLoader {
22148
22148
  return resolvedId;
22149
22149
  }
22150
22150
  async loadEntryModule(unresolvedId, isEntry, importer, implicitlyLoadedBefore) {
22151
- const resolveIdResult = await resolveId(unresolvedId, importer, this.options.preserveSymlinks, this.pluginDriver, this.resolveId, null, EMPTY_OBJECT);
22151
+ const resolveIdResult = await resolveId(unresolvedId, importer, this.options.preserveSymlinks, this.pluginDriver, this.resolveId, null, EMPTY_OBJECT, true);
22152
22152
  if (resolveIdResult == null) {
22153
22153
  return error(implicitlyLoadedBefore === null
22154
22154
  ? errUnresolvedEntry(unresolvedId)
@@ -22185,7 +22185,7 @@ class ModuleLoader {
22185
22185
  if (resolution == null) {
22186
22186
  return (module.resolvedIds[specifier] =
22187
22187
  module.resolvedIds[specifier] ||
22188
- this.handleResolveId(await this.resolveId(specifier, module.id, EMPTY_OBJECT), specifier, module.id));
22188
+ this.handleResolveId(await this.resolveId(specifier, module.id, EMPTY_OBJECT, false), specifier, module.id));
22189
22189
  }
22190
22190
  return this.handleResolveId(this.addDefaultsToResolvedId(this.getNormalizedResolvedIdWithoutDefaults(resolution, importer, specifier)), specifier, importer);
22191
22191
  }
@@ -22306,11 +22306,11 @@ function getPluginContext(plugin, pluginCache, graph, options, fileEmitter, exis
22306
22306
  return wrappedModuleIds();
22307
22307
  },
22308
22308
  parse: graph.contextParse.bind(graph),
22309
- resolve(source, importer, { custom, skipSelf } = BLANK) {
22310
- return graph.moduleLoader.resolveId(source, importer, custom, skipSelf ? [{ importer, plugin, source }] : null);
22309
+ resolve(source, importer, { custom, isEntry, skipSelf } = BLANK) {
22310
+ return graph.moduleLoader.resolveId(source, importer, custom, isEntry, skipSelf ? [{ importer, plugin, source }] : null);
22311
22311
  },
22312
22312
  resolveId: getDeprecatedContextHandler((source, importer) => graph.moduleLoader
22313
- .resolveId(source, importer, BLANK)
22313
+ .resolveId(source, importer, BLANK, undefined)
22314
22314
  .then(resolveId => resolveId && resolveId.id), 'resolveId', 'resolve', plugin.name, true, options),
22315
22315
  setAssetSource: fileEmitter.setAssetSource,
22316
22316
  warn(warning) {
@@ -23471,10 +23471,10 @@ function getFsEvents() {
23471
23471
  return fsEvents;
23472
23472
  }
23473
23473
 
23474
- var fseventsImporter = {
23474
+ const fseventsImporter = {
23475
23475
  __proto__: null,
23476
- loadFsEvents: loadFsEvents,
23477
- getFsEvents: getFsEvents
23476
+ loadFsEvents,
23477
+ getFsEvents
23478
23478
  };
23479
23479
 
23480
23480
  class WatchEmitter extends EventEmitter {
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.57.0
4
- Wed, 22 Sep 2021 04:43:07 GMT - commit b67ef301e8e44f9e0d9b144c0cce441e2a41c3da
3
+ Rollup.js v2.58.0
4
+ Fri, 01 Oct 2021 06:54:03 GMT - commit 3a404a07f41a10d10b7af536f05b90ea46d8ad3d
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -632,8 +632,128 @@ var isExtglob$1 = function isExtglob(str) {
632
632
 
633
633
  var isExtglob = isExtglob$1;
634
634
  var chars = { '{': '}', '(': ')', '[': ']'};
635
- var strictRegex = /\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/;
636
- var relaxedRegex = /\\(.)|(^!|[*?{}()[\]]|\(\?)/;
635
+ var strictCheck = function(str) {
636
+ if (str[0] === '!') {
637
+ return true;
638
+ }
639
+ var index = 0;
640
+ var pipeIndex = -2;
641
+ var closeSquareIndex = -2;
642
+ var closeCurlyIndex = -2;
643
+ var closeParenIndex = -2;
644
+ var backSlashIndex = -2;
645
+ while (index < str.length) {
646
+ if (str[index] === '*') {
647
+ return true;
648
+ }
649
+
650
+ if (str[index + 1] === '?' && /[\].+)]/.test(str[index])) {
651
+ return true;
652
+ }
653
+
654
+ if (closeSquareIndex !== -1 && str[index] === '[' && str[index + 1] !== ']') {
655
+ if (closeSquareIndex < index) {
656
+ closeSquareIndex = str.indexOf(']', index);
657
+ }
658
+ if (closeSquareIndex > index) {
659
+ if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
660
+ return true;
661
+ }
662
+ backSlashIndex = str.indexOf('\\', index);
663
+ if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
664
+ return true;
665
+ }
666
+ }
667
+ }
668
+
669
+ if (closeCurlyIndex !== -1 && str[index] === '{' && str[index + 1] !== '}') {
670
+ closeCurlyIndex = str.indexOf('}', index);
671
+ if (closeCurlyIndex > index) {
672
+ backSlashIndex = str.indexOf('\\', index);
673
+ if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) {
674
+ return true;
675
+ }
676
+ }
677
+ }
678
+
679
+ if (closeParenIndex !== -1 && str[index] === '(' && str[index + 1] === '?' && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ')') {
680
+ closeParenIndex = str.indexOf(')', index);
681
+ if (closeParenIndex > index) {
682
+ backSlashIndex = str.indexOf('\\', index);
683
+ if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
684
+ return true;
685
+ }
686
+ }
687
+ }
688
+
689
+ if (pipeIndex !== -1 && str[index] === '(' && str[index + 1] !== '|') {
690
+ if (pipeIndex < index) {
691
+ pipeIndex = str.indexOf('|', index);
692
+ }
693
+ if (pipeIndex !== -1 && str[pipeIndex + 1] !== ')') {
694
+ closeParenIndex = str.indexOf(')', pipeIndex);
695
+ if (closeParenIndex > pipeIndex) {
696
+ backSlashIndex = str.indexOf('\\', pipeIndex);
697
+ if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
698
+ return true;
699
+ }
700
+ }
701
+ }
702
+ }
703
+
704
+ if (str[index] === '\\') {
705
+ var open = str[index + 1];
706
+ index += 2;
707
+ var close = chars[open];
708
+
709
+ if (close) {
710
+ var n = str.indexOf(close, index);
711
+ if (n !== -1) {
712
+ index = n + 1;
713
+ }
714
+ }
715
+
716
+ if (str[index] === '!') {
717
+ return true;
718
+ }
719
+ } else {
720
+ index++;
721
+ }
722
+ }
723
+ return false;
724
+ };
725
+
726
+ var relaxedCheck = function(str) {
727
+ if (str[0] === '!') {
728
+ return true;
729
+ }
730
+ var index = 0;
731
+ while (index < str.length) {
732
+ if (/[*?{}()[\]]/.test(str[index])) {
733
+ return true;
734
+ }
735
+
736
+ if (str[index] === '\\') {
737
+ var open = str[index + 1];
738
+ index += 2;
739
+ var close = chars[open];
740
+
741
+ if (close) {
742
+ var n = str.indexOf(close, index);
743
+ if (n !== -1) {
744
+ index = n + 1;
745
+ }
746
+ }
747
+
748
+ if (str[index] === '!') {
749
+ return true;
750
+ }
751
+ } else {
752
+ index++;
753
+ }
754
+ }
755
+ return false;
756
+ };
637
757
 
638
758
  var isGlob$2 = function isGlob(str, options) {
639
759
  if (typeof str !== 'string' || str === '') {
@@ -644,32 +764,14 @@ var isGlob$2 = function isGlob(str, options) {
644
764
  return true;
645
765
  }
646
766
 
647
- var regex = strictRegex;
648
- var match;
767
+ var check = strictCheck;
649
768
 
650
- // optionally relax regex
769
+ // optionally relax check
651
770
  if (options && options.strict === false) {
652
- regex = relaxedRegex;
771
+ check = relaxedCheck;
653
772
  }
654
773
 
655
- while ((match = regex.exec(str))) {
656
- if (match[2]) return true;
657
- var idx = match.index + match[0].length;
658
-
659
- // if an open bracket/brace/paren is escaped,
660
- // set the index to the next closing character
661
- var open = match[1];
662
- var close = open ? chars[open] : null;
663
- if (open && close) {
664
- var n = str.indexOf(close, idx);
665
- if (n !== -1) {
666
- idx = n + 1;
667
- }
668
- }
669
-
670
- str = str.slice(idx);
671
- }
672
- return false;
774
+ return check(str);
673
775
  };
674
776
 
675
777
  var isGlob$1 = isGlob$2;
@@ -2133,7 +2235,7 @@ braces$1.create = (input, options = {}) => {
2133
2235
 
2134
2236
  var braces_1 = braces$1;
2135
2237
 
2136
- var require$$0 = [
2238
+ const require$$0 = [
2137
2239
  "3dm",
2138
2240
  "3ds",
2139
2241
  "3g2",
@@ -3109,7 +3211,7 @@ var nodefsHandler = NodeFsHandler$1;
3109
3211
 
3110
3212
  var fseventsHandler = {exports: {}};
3111
3213
 
3112
- var require$$3 = /*@__PURE__*/getAugmentedNamespace(fseventsImporter);
3214
+ const require$$3 = /*@__PURE__*/getAugmentedNamespace(fseventsImporter);
3113
3215
 
3114
3216
  const fs$1 = fs$4;
3115
3217
  const sysPath$1 = require$$0__default;
@@ -4606,7 +4708,7 @@ const watch = (paths, options) => {
4606
4708
 
4607
4709
  chokidar$1.watch = watch;
4608
4710
 
4609
- var chokidar = chokidar$1;
4711
+ const chokidar = chokidar$1;
4610
4712
 
4611
4713
  class FileWatcher {
4612
4714
  constructor(task, chokidarOptions) {
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.57.0
4
- Wed, 22 Sep 2021 04:43:07 GMT - commit b67ef301e8e44f9e0d9b144c0cce441e2a41c3da
3
+ Rollup.js v2.58.0
4
+ Fri, 01 Oct 2021 06:54:03 GMT - commit 3a404a07f41a10d10b7af536f05b90ea46d8ad3d
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -13,7 +13,7 @@
13
13
  require('fs');
14
14
  require('path');
15
15
  require('url');
16
- var loadConfigFile_js = require('./shared/loadConfigFile.js');
16
+ const loadConfigFile_js = require('./shared/loadConfigFile.js');
17
17
  require('./shared/rollup.js');
18
18
  require('./shared/mergeOptions.js');
19
19
  require('tty');