@rollup/plugin-commonjs 22.0.0-7 → 22.0.0-8

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/cjs/index.js CHANGED
@@ -16,7 +16,7 @@ var glob__default = /*#__PURE__*/_interopDefaultLegacy(glob);
16
16
  var MagicString__default = /*#__PURE__*/_interopDefaultLegacy(MagicString);
17
17
  var isReference__default = /*#__PURE__*/_interopDefaultLegacy(isReference);
18
18
 
19
- var version = "22.0.0-7";
19
+ var version = "22.0.0-8";
20
20
  var peerDependencies = {
21
21
  rollup: "^2.66.1"
22
22
  };
@@ -562,7 +562,13 @@ function getResolveId(extensions) {
562
562
  const resolved =
563
563
  (await this.resolve(importee, importer, Object.assign({ skipSelf: true }, resolveOptions))) ||
564
564
  resolveExtensions(importee, importer, extensions);
565
- if (!resolved || resolved.external) {
565
+ // Make sure that even if other plugins resolve again, we ignore our own proxies
566
+ if (
567
+ !resolved ||
568
+ resolved.external ||
569
+ resolved.id.endsWith(ENTRY_SUFFIX) ||
570
+ isWrappedId(resolved.id, ES_IMPORT_SUFFIX)
571
+ ) {
566
572
  return resolved;
567
573
  }
568
574
  if (resolveOptions.isEntry) {
@@ -1830,6 +1836,8 @@ function ${requireName} () {
1830
1836
  };
1831
1837
  }
1832
1838
 
1839
+ const PLUGIN_NAME = 'commonjs';
1840
+
1833
1841
  function commonjs(options = {}) {
1834
1842
  const {
1835
1843
  ignoreGlobal,
@@ -1965,7 +1973,7 @@ function commonjs(options = {}) {
1965
1973
  }
1966
1974
 
1967
1975
  return {
1968
- name: 'commonjs',
1976
+ name: PLUGIN_NAME,
1969
1977
 
1970
1978
  version,
1971
1979
 
@@ -1973,7 +1981,7 @@ function commonjs(options = {}) {
1973
1981
  // We inject the resolver in the beginning so that "catch-all-resolver" like node-resolver
1974
1982
  // do not prevent our plugin from resolving entry points ot proxies.
1975
1983
  const plugins = Array.isArray(rawOptions.plugins)
1976
- ? rawOptions.plugins
1984
+ ? [...rawOptions.plugins]
1977
1985
  : rawOptions.plugins
1978
1986
  ? [rawOptions.plugins]
1979
1987
  : [];