@rollup/plugin-commonjs 25.0.7 → 26.0.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/cjs/index.js +10 -3
- package/dist/es/index.js +10 -3
- package/package.json +17 -20
package/dist/cjs/index.js
CHANGED
|
@@ -11,7 +11,7 @@ var estreeWalker = require('estree-walker');
|
|
|
11
11
|
var MagicString = require('magic-string');
|
|
12
12
|
var isReference = require('is-reference');
|
|
13
13
|
|
|
14
|
-
var version = "
|
|
14
|
+
var version = "26.0.0";
|
|
15
15
|
var peerDependencies = {
|
|
16
16
|
rollup: "^2.68.0||^3.0.0||^4.0.0"
|
|
17
17
|
};
|
|
@@ -178,7 +178,9 @@ function getDynamicRequireModules(patterns, dynamicRequireRoot) {
|
|
|
178
178
|
isNegated
|
|
179
179
|
? dynamicRequireModules.delete(targetPath)
|
|
180
180
|
: dynamicRequireModules.set(targetPath, resolvedPath);
|
|
181
|
-
for (const path$1 of glob
|
|
181
|
+
for (const path$1 of glob
|
|
182
|
+
.sync(isNegated ? pattern.substr(1) : pattern)
|
|
183
|
+
.sort((a, b) => a.localeCompare(b, 'en'))) {
|
|
182
184
|
const resolvedPath = path.resolve(path$1);
|
|
183
185
|
const requirePath = normalizePathSlashes(resolvedPath);
|
|
184
186
|
if (isDirectory(resolvedPath)) {
|
|
@@ -1718,7 +1720,12 @@ async function transformCommonjs(
|
|
|
1718
1720
|
return;
|
|
1719
1721
|
case 'Identifier': {
|
|
1720
1722
|
const { name } = node;
|
|
1721
|
-
if (
|
|
1723
|
+
if (
|
|
1724
|
+
!isReference(node, parent) ||
|
|
1725
|
+
scope.contains(name) ||
|
|
1726
|
+
(parent.type === 'PropertyDefinition' && parent.key === node)
|
|
1727
|
+
)
|
|
1728
|
+
return;
|
|
1722
1729
|
switch (name) {
|
|
1723
1730
|
case 'require':
|
|
1724
1731
|
uses.require = true;
|
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 = "
|
|
10
|
+
var version = "26.0.0";
|
|
11
11
|
var peerDependencies = {
|
|
12
12
|
rollup: "^2.68.0||^3.0.0||^4.0.0"
|
|
13
13
|
};
|
|
@@ -174,7 +174,9 @@ function getDynamicRequireModules(patterns, dynamicRequireRoot) {
|
|
|
174
174
|
isNegated
|
|
175
175
|
? dynamicRequireModules.delete(targetPath)
|
|
176
176
|
: dynamicRequireModules.set(targetPath, resolvedPath);
|
|
177
|
-
for (const path of glob
|
|
177
|
+
for (const path of glob
|
|
178
|
+
.sync(isNegated ? pattern.substr(1) : pattern)
|
|
179
|
+
.sort((a, b) => a.localeCompare(b, 'en'))) {
|
|
178
180
|
const resolvedPath = resolve(path);
|
|
179
181
|
const requirePath = normalizePathSlashes(resolvedPath);
|
|
180
182
|
if (isDirectory(resolvedPath)) {
|
|
@@ -1714,7 +1716,12 @@ async function transformCommonjs(
|
|
|
1714
1716
|
return;
|
|
1715
1717
|
case 'Identifier': {
|
|
1716
1718
|
const { name } = node;
|
|
1717
|
-
if (
|
|
1719
|
+
if (
|
|
1720
|
+
!isReference(node, parent) ||
|
|
1721
|
+
scope.contains(name) ||
|
|
1722
|
+
(parent.type === 'PropertyDefinition' && parent.key === node)
|
|
1723
|
+
)
|
|
1724
|
+
return;
|
|
1718
1725
|
switch (name) {
|
|
1719
1726
|
case 'require':
|
|
1720
1727
|
uses.require = true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rollup/plugin-commonjs",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "26.0.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -21,22 +21,7 @@
|
|
|
21
21
|
"default": "./dist/cjs/index.js"
|
|
22
22
|
},
|
|
23
23
|
"engines": {
|
|
24
|
-
"node": ">=
|
|
25
|
-
},
|
|
26
|
-
"scripts": {
|
|
27
|
-
"build": "rollup -c",
|
|
28
|
-
"ci:coverage": "nyc pnpm test && nyc report --reporter=text-lcov > coverage.lcov",
|
|
29
|
-
"ci:lint": "pnpm build && pnpm lint",
|
|
30
|
-
"ci:lint:commits": "commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}",
|
|
31
|
-
"ci:test": "pnpm test -- --verbose && pnpm test:ts",
|
|
32
|
-
"prebuild": "del-cli dist",
|
|
33
|
-
"prepare": "if [ ! -d 'dist' ]; then pnpm build; fi",
|
|
34
|
-
"prepublishOnly": "pnpm build",
|
|
35
|
-
"prerelease": "pnpm build",
|
|
36
|
-
"pretest": "pnpm build",
|
|
37
|
-
"release": "pnpm --workspace-root plugin:release --pkg $npm_package_name",
|
|
38
|
-
"test": "ava",
|
|
39
|
-
"test:ts": "tsc types/index.d.ts test/types.ts --noEmit"
|
|
24
|
+
"node": ">=16.0.0 || 14 >= 14.17"
|
|
40
25
|
},
|
|
41
26
|
"files": [
|
|
42
27
|
"dist",
|
|
@@ -65,7 +50,7 @@
|
|
|
65
50
|
"@rollup/pluginutils": "^5.0.1",
|
|
66
51
|
"commondir": "^1.0.1",
|
|
67
52
|
"estree-walker": "^2.0.2",
|
|
68
|
-
"glob": "^
|
|
53
|
+
"glob": "^10.4.1",
|
|
69
54
|
"is-reference": "1.2.1",
|
|
70
55
|
"magic-string": "^0.30.3"
|
|
71
56
|
},
|
|
@@ -75,7 +60,6 @@
|
|
|
75
60
|
"locate-character": "^2.0.5",
|
|
76
61
|
"require-relative": "^0.8.7",
|
|
77
62
|
"rollup": "^4.0.0-24",
|
|
78
|
-
"shx": "^0.3.4",
|
|
79
63
|
"source-map": "^0.7.4",
|
|
80
64
|
"source-map-support": "^0.5.21",
|
|
81
65
|
"typescript": "^4.8.3"
|
|
@@ -89,5 +73,18 @@
|
|
|
89
73
|
"!**/recipes/**",
|
|
90
74
|
"!**/types.ts"
|
|
91
75
|
]
|
|
76
|
+
},
|
|
77
|
+
"scripts": {
|
|
78
|
+
"build": "rollup -c",
|
|
79
|
+
"ci:coverage": "nyc pnpm test && nyc report --reporter=text-lcov > coverage.lcov",
|
|
80
|
+
"ci:lint": "pnpm build && pnpm lint",
|
|
81
|
+
"ci:lint:commits": "commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}",
|
|
82
|
+
"ci:test": "pnpm test -- --verbose && pnpm test:ts",
|
|
83
|
+
"prebuild": "del-cli dist",
|
|
84
|
+
"prerelease": "pnpm build",
|
|
85
|
+
"pretest": "pnpm build",
|
|
86
|
+
"release": "pnpm --workspace-root package:release $(pwd)",
|
|
87
|
+
"test": "ava",
|
|
88
|
+
"test:ts": "tsc types/index.d.ts test/types.ts --noEmit"
|
|
92
89
|
}
|
|
93
|
-
}
|
|
90
|
+
}
|