@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 +12 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/index.js +12 -4
- package/dist/es/index.js.map +1 -1
- package/package.json +1 -1
package/dist/es/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { walk } from 'estree-walker';
|
|
|
7
7
|
import MagicString from 'magic-string';
|
|
8
8
|
import isReference from 'is-reference';
|
|
9
9
|
|
|
10
|
-
var version = "22.0.0-
|
|
10
|
+
var version = "22.0.0-8";
|
|
11
11
|
var peerDependencies = {
|
|
12
12
|
rollup: "^2.66.1"
|
|
13
13
|
};
|
|
@@ -553,7 +553,13 @@ function getResolveId(extensions) {
|
|
|
553
553
|
const resolved =
|
|
554
554
|
(await this.resolve(importee, importer, Object.assign({ skipSelf: true }, resolveOptions))) ||
|
|
555
555
|
resolveExtensions(importee, importer, extensions);
|
|
556
|
-
if
|
|
556
|
+
// Make sure that even if other plugins resolve again, we ignore our own proxies
|
|
557
|
+
if (
|
|
558
|
+
!resolved ||
|
|
559
|
+
resolved.external ||
|
|
560
|
+
resolved.id.endsWith(ENTRY_SUFFIX) ||
|
|
561
|
+
isWrappedId(resolved.id, ES_IMPORT_SUFFIX)
|
|
562
|
+
) {
|
|
557
563
|
return resolved;
|
|
558
564
|
}
|
|
559
565
|
if (resolveOptions.isEntry) {
|
|
@@ -1821,6 +1827,8 @@ function ${requireName} () {
|
|
|
1821
1827
|
};
|
|
1822
1828
|
}
|
|
1823
1829
|
|
|
1830
|
+
const PLUGIN_NAME = 'commonjs';
|
|
1831
|
+
|
|
1824
1832
|
function commonjs(options = {}) {
|
|
1825
1833
|
const {
|
|
1826
1834
|
ignoreGlobal,
|
|
@@ -1956,7 +1964,7 @@ function commonjs(options = {}) {
|
|
|
1956
1964
|
}
|
|
1957
1965
|
|
|
1958
1966
|
return {
|
|
1959
|
-
name:
|
|
1967
|
+
name: PLUGIN_NAME,
|
|
1960
1968
|
|
|
1961
1969
|
version,
|
|
1962
1970
|
|
|
@@ -1964,7 +1972,7 @@ function commonjs(options = {}) {
|
|
|
1964
1972
|
// We inject the resolver in the beginning so that "catch-all-resolver" like node-resolver
|
|
1965
1973
|
// do not prevent our plugin from resolving entry points ot proxies.
|
|
1966
1974
|
const plugins = Array.isArray(rawOptions.plugins)
|
|
1967
|
-
? rawOptions.plugins
|
|
1975
|
+
? [...rawOptions.plugins]
|
|
1968
1976
|
: rawOptions.plugins
|
|
1969
1977
|
? [rawOptions.plugins]
|
|
1970
1978
|
: [];
|