@rollup/plugin-node-resolve 14.0.1 → 15.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/README.md +10 -3
- package/dist/cjs/index.js +72 -26
- package/dist/es/index.js +57 -3
- package/package.json +25 -21
- package/types/index.d.ts +8 -1
package/README.md
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|
|
14
14
|
## Requirements
|
15
15
|
|
16
|
-
This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (
|
16
|
+
This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v14.0.0+) and Rollup v2.78.0+.
|
17
17
|
|
18
18
|
## Install
|
19
19
|
|
@@ -75,7 +75,14 @@ If `true`, instructs the plugin to use the browser module resolutions in `packag
|
|
75
75
|
Type: `Array[...String]`<br>
|
76
76
|
Default: `['node_modules']`
|
77
77
|
|
78
|
-
|
78
|
+
A list of directory names in which to recursively look for modules.
|
79
|
+
|
80
|
+
### `modulePaths`
|
81
|
+
|
82
|
+
Type: `Array[...String]`<br>
|
83
|
+
Default: `[]`
|
84
|
+
|
85
|
+
A list of absolute paths to additional locations to search for modules. [This is analogous to setting the `NODE_PATH` environment variable for node](https://nodejs.org/api/modules.html#loading-from-the-global-folders).
|
79
86
|
|
80
87
|
### `dedupe`
|
81
88
|
|
@@ -214,7 +221,7 @@ export default ({
|
|
214
221
|
})
|
215
222
|
```
|
216
223
|
|
217
|
-
## Resolving
|
224
|
+
## Resolving Require Statements
|
218
225
|
|
219
226
|
According to [NodeJS module resolution](https://nodejs.org/api/packages.html#packages_package_entry_points) `require` statements should resolve using the `require` condition in the package exports field, while es modules should use the `import` condition.
|
220
227
|
|
package/dist/cjs/index.js
CHANGED
@@ -12,21 +12,15 @@ var url = require('url');
|
|
12
12
|
var resolve = require('resolve');
|
13
13
|
var pluginutils = require('@rollup/pluginutils');
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
var deepMerge__default = /*#__PURE__*/_interopDefaultLegacy(deepMerge);
|
20
|
-
var isModule__default = /*#__PURE__*/_interopDefaultLegacy(isModule);
|
21
|
-
var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
|
22
|
-
var resolve__default = /*#__PURE__*/_interopDefaultLegacy(resolve);
|
23
|
-
|
24
|
-
var version = "14.0.1";
|
15
|
+
var version = "15.0.0";
|
16
|
+
var peerDependencies = {
|
17
|
+
rollup: "^2.78.0||^3.0.0"
|
18
|
+
};
|
25
19
|
|
26
|
-
util.promisify(
|
27
|
-
const readFile$1 = util.promisify(
|
28
|
-
const realpath = util.promisify(
|
29
|
-
const stat = util.promisify(
|
20
|
+
util.promisify(fs.access);
|
21
|
+
const readFile$1 = util.promisify(fs.readFile);
|
22
|
+
const realpath = util.promisify(fs.realpath);
|
23
|
+
const stat = util.promisify(fs.stat);
|
30
24
|
|
31
25
|
async function fileExists(filePath) {
|
32
26
|
try {
|
@@ -320,16 +314,16 @@ function isModuleDir(current, moduleDirs) {
|
|
320
314
|
}
|
321
315
|
|
322
316
|
async function findPackageJson(base, moduleDirs) {
|
323
|
-
const { root } =
|
317
|
+
const { root } = path.parse(base);
|
324
318
|
let current = base;
|
325
319
|
|
326
320
|
while (current !== root && !isModuleDir(current, moduleDirs)) {
|
327
|
-
const pkgJsonPath =
|
321
|
+
const pkgJsonPath = path.join(current, 'package.json');
|
328
322
|
if (await fileExists(pkgJsonPath)) {
|
329
|
-
const pkgJsonString =
|
323
|
+
const pkgJsonString = fs.readFileSync(pkgJsonPath, 'utf-8');
|
330
324
|
return { pkgJson: JSON.parse(pkgJsonString), pkgPath: current, pkgJsonPath };
|
331
325
|
}
|
332
|
-
current =
|
326
|
+
current = path.resolve(current, '..');
|
333
327
|
}
|
334
328
|
return null;
|
335
329
|
}
|
@@ -613,8 +607,8 @@ async function resolvePackageImports({
|
|
613
607
|
});
|
614
608
|
}
|
615
609
|
|
616
|
-
const resolveImportPath = util.promisify(
|
617
|
-
const readFile = util.promisify(
|
610
|
+
const resolveImportPath = util.promisify(resolve);
|
611
|
+
const readFile = util.promisify(fs.readFile);
|
618
612
|
|
619
613
|
async function getPackageJson(importer, pkgName, resolveOptions, moduleDirectories) {
|
620
614
|
if (importer) {
|
@@ -643,6 +637,7 @@ async function resolveIdClassic({
|
|
643
637
|
useBrowserOverrides,
|
644
638
|
baseDir,
|
645
639
|
moduleDirectories,
|
640
|
+
modulePaths,
|
646
641
|
rootDir,
|
647
642
|
ignoreSideEffectsForRoot
|
648
643
|
}) {
|
@@ -677,6 +672,7 @@ async function resolveIdClassic({
|
|
677
672
|
extensions,
|
678
673
|
includeCoreModules: false,
|
679
674
|
moduleDirectory: moduleDirectories,
|
675
|
+
paths: modulePaths,
|
680
676
|
preserveSymlinks,
|
681
677
|
packageFilter: filter
|
682
678
|
};
|
@@ -711,6 +707,7 @@ async function resolveWithExportMap({
|
|
711
707
|
useBrowserOverrides,
|
712
708
|
baseDir,
|
713
709
|
moduleDirectories,
|
710
|
+
modulePaths,
|
714
711
|
rootDir,
|
715
712
|
ignoreSideEffectsForRoot
|
716
713
|
}) {
|
@@ -730,7 +727,8 @@ async function resolveWithExportMap({
|
|
730
727
|
preserveSymlinks,
|
731
728
|
useBrowserOverrides,
|
732
729
|
baseDir,
|
733
|
-
moduleDirectories
|
730
|
+
moduleDirectories,
|
731
|
+
modulePaths
|
734
732
|
});
|
735
733
|
}
|
736
734
|
});
|
@@ -780,6 +778,7 @@ async function resolveWithExportMap({
|
|
780
778
|
extensions,
|
781
779
|
includeCoreModules: false,
|
782
780
|
moduleDirectory: moduleDirectories,
|
781
|
+
paths: modulePaths,
|
783
782
|
preserveSymlinks,
|
784
783
|
packageFilter: filter
|
785
784
|
};
|
@@ -830,6 +829,7 @@ async function resolveWithClassic({
|
|
830
829
|
useBrowserOverrides,
|
831
830
|
baseDir,
|
832
831
|
moduleDirectories,
|
832
|
+
modulePaths,
|
833
833
|
rootDir,
|
834
834
|
ignoreSideEffectsForRoot
|
835
835
|
}) {
|
@@ -847,6 +847,7 @@ async function resolveWithClassic({
|
|
847
847
|
useBrowserOverrides,
|
848
848
|
baseDir,
|
849
849
|
moduleDirectories,
|
850
|
+
modulePaths,
|
850
851
|
rootDir,
|
851
852
|
ignoreSideEffectsForRoot
|
852
853
|
});
|
@@ -875,6 +876,7 @@ async function resolveImportSpecifiers({
|
|
875
876
|
useBrowserOverrides,
|
876
877
|
baseDir,
|
877
878
|
moduleDirectories,
|
879
|
+
modulePaths,
|
878
880
|
rootDir,
|
879
881
|
ignoreSideEffectsForRoot
|
880
882
|
}) {
|
@@ -890,6 +892,7 @@ async function resolveImportSpecifiers({
|
|
890
892
|
useBrowserOverrides,
|
891
893
|
baseDir,
|
892
894
|
moduleDirectories,
|
895
|
+
modulePaths,
|
893
896
|
rootDir,
|
894
897
|
ignoreSideEffectsForRoot
|
895
898
|
});
|
@@ -915,11 +918,44 @@ async function resolveImportSpecifiers({
|
|
915
918
|
useBrowserOverrides,
|
916
919
|
baseDir,
|
917
920
|
moduleDirectories,
|
921
|
+
modulePaths,
|
918
922
|
rootDir,
|
919
923
|
ignoreSideEffectsForRoot
|
920
924
|
});
|
921
925
|
}
|
922
926
|
|
927
|
+
const versionRegexp = /\^(\d+\.\d+\.\d+)/g;
|
928
|
+
|
929
|
+
function validateVersion(actualVersion, peerDependencyVersion) {
|
930
|
+
let minMajor = Infinity;
|
931
|
+
let minMinor = Infinity;
|
932
|
+
let minPatch = Infinity;
|
933
|
+
let foundVersion;
|
934
|
+
// eslint-disable-next-line no-cond-assign
|
935
|
+
while ((foundVersion = versionRegexp.exec(peerDependencyVersion))) {
|
936
|
+
const [foundMajor, foundMinor, foundPatch] = foundVersion[1].split('.').map(Number);
|
937
|
+
if (foundMajor < minMajor) {
|
938
|
+
minMajor = foundMajor;
|
939
|
+
minMinor = foundMinor;
|
940
|
+
minPatch = foundPatch;
|
941
|
+
}
|
942
|
+
}
|
943
|
+
if (!actualVersion) {
|
944
|
+
throw new Error(
|
945
|
+
`Insufficient Rollup version: "@rollup/plugin-node-resolve" requires at least rollup@${minMajor}.${minMinor}.${minPatch}.`
|
946
|
+
);
|
947
|
+
}
|
948
|
+
const [major, minor, patch] = actualVersion.split('.').map(Number);
|
949
|
+
if (
|
950
|
+
major < minMajor ||
|
951
|
+
(major === minMajor && (minor < minMinor || (minor === minMinor && patch < minPatch)))
|
952
|
+
) {
|
953
|
+
throw new Error(
|
954
|
+
`Insufficient rollup version: "@rollup/plugin-node-resolve" requires at least rollup@${minMajor}.${minMinor}.${minPatch} but found rollup@${actualVersion}.`
|
955
|
+
);
|
956
|
+
}
|
957
|
+
}
|
958
|
+
|
923
959
|
/* eslint-disable no-param-reassign, no-shadow, no-undefined */
|
924
960
|
|
925
961
|
const ES6_BROWSER_EMPTY = '\0node-resolve:empty.js';
|
@@ -947,13 +983,13 @@ const defaults = {
|
|
947
983
|
moduleDirectories: ['node_modules'],
|
948
984
|
ignoreSideEffectsForRoot: false
|
949
985
|
};
|
950
|
-
const DEFAULTS = deepFreeze(
|
986
|
+
const DEFAULTS = deepFreeze(deepMerge({}, defaults));
|
951
987
|
|
952
988
|
function nodeResolve(opts = {}) {
|
953
989
|
const { warnings } = handleDeprecatedOptions(opts);
|
954
990
|
|
955
991
|
const options = { ...defaults, ...opts };
|
956
|
-
const { extensions, jail, moduleDirectories, ignoreSideEffectsForRoot } = options;
|
992
|
+
const { extensions, jail, moduleDirectories, modulePaths, ignoreSideEffectsForRoot } = options;
|
957
993
|
const conditionsEsm = [...baseConditionsEsm, ...(options.exportConditions || [])];
|
958
994
|
const conditionsCjs = [...baseConditionsCjs, ...(options.exportConditions || [])];
|
959
995
|
const packageInfoCache = new Map();
|
@@ -966,6 +1002,12 @@ function nodeResolve(opts = {}) {
|
|
966
1002
|
let { dedupe } = options;
|
967
1003
|
let rollupOptions;
|
968
1004
|
|
1005
|
+
if (moduleDirectories.some((name) => name.includes('/'))) {
|
1006
|
+
throw new Error(
|
1007
|
+
'`moduleDirectories` option must only contain directory names. If you want to load modules from somewhere not supported by the default module resolution algorithm, see `modulePaths`.'
|
1008
|
+
);
|
1009
|
+
}
|
1010
|
+
|
969
1011
|
if (typeof dedupe !== 'function') {
|
970
1012
|
dedupe = (importee) =>
|
971
1013
|
options.dedupe.includes(importee) || options.dedupe.includes(getPackageName(importee));
|
@@ -1076,11 +1118,12 @@ function nodeResolve(opts = {}) {
|
|
1076
1118
|
useBrowserOverrides,
|
1077
1119
|
baseDir,
|
1078
1120
|
moduleDirectories,
|
1121
|
+
modulePaths,
|
1079
1122
|
rootDir,
|
1080
1123
|
ignoreSideEffectsForRoot
|
1081
1124
|
});
|
1082
1125
|
|
1083
|
-
const importeeIsBuiltin =
|
1126
|
+
const importeeIsBuiltin = isBuiltinModule(importee);
|
1084
1127
|
const resolved =
|
1085
1128
|
importeeIsBuiltin && preferBuiltins
|
1086
1129
|
? {
|
@@ -1131,7 +1174,7 @@ function nodeResolve(opts = {}) {
|
|
1131
1174
|
|
1132
1175
|
if (options.modulesOnly && (await fileExists(location))) {
|
1133
1176
|
const code = await readFile$1(location, 'utf-8');
|
1134
|
-
if (
|
1177
|
+
if (isModule(code)) {
|
1135
1178
|
return {
|
1136
1179
|
id: `${location}${importSuffix}`,
|
1137
1180
|
moduleSideEffects: hasModuleSideEffects(location)
|
@@ -1151,6 +1194,7 @@ function nodeResolve(opts = {}) {
|
|
1151
1194
|
version,
|
1152
1195
|
|
1153
1196
|
buildStart(buildOptions) {
|
1197
|
+
validateVersion(this.meta.rollupVersion, peerDependencies.rollup);
|
1154
1198
|
rollupOptions = buildOptions;
|
1155
1199
|
|
1156
1200
|
for (const warning of warnings) {
|
@@ -1228,5 +1272,7 @@ function nodeResolve(opts = {}) {
|
|
1228
1272
|
}
|
1229
1273
|
|
1230
1274
|
exports.DEFAULTS = DEFAULTS;
|
1231
|
-
exports
|
1275
|
+
exports.default = nodeResolve;
|
1232
1276
|
exports.nodeResolve = nodeResolve;
|
1277
|
+
module.exports = Object.assign(exports.default, exports);
|
1278
|
+
//# sourceMappingURL=index.js.map
|
package/dist/es/index.js
CHANGED
@@ -8,7 +8,10 @@ import { pathToFileURL, fileURLToPath } from 'url';
|
|
8
8
|
import resolve$1 from 'resolve';
|
9
9
|
import { createFilter } from '@rollup/pluginutils';
|
10
10
|
|
11
|
-
var version = "
|
11
|
+
var version = "15.0.0";
|
12
|
+
var peerDependencies = {
|
13
|
+
rollup: "^2.78.0||^3.0.0"
|
14
|
+
};
|
12
15
|
|
13
16
|
promisify(fs.access);
|
14
17
|
const readFile$1 = promisify(fs.readFile);
|
@@ -630,6 +633,7 @@ async function resolveIdClassic({
|
|
630
633
|
useBrowserOverrides,
|
631
634
|
baseDir,
|
632
635
|
moduleDirectories,
|
636
|
+
modulePaths,
|
633
637
|
rootDir,
|
634
638
|
ignoreSideEffectsForRoot
|
635
639
|
}) {
|
@@ -664,6 +668,7 @@ async function resolveIdClassic({
|
|
664
668
|
extensions,
|
665
669
|
includeCoreModules: false,
|
666
670
|
moduleDirectory: moduleDirectories,
|
671
|
+
paths: modulePaths,
|
667
672
|
preserveSymlinks,
|
668
673
|
packageFilter: filter
|
669
674
|
};
|
@@ -698,6 +703,7 @@ async function resolveWithExportMap({
|
|
698
703
|
useBrowserOverrides,
|
699
704
|
baseDir,
|
700
705
|
moduleDirectories,
|
706
|
+
modulePaths,
|
701
707
|
rootDir,
|
702
708
|
ignoreSideEffectsForRoot
|
703
709
|
}) {
|
@@ -717,7 +723,8 @@ async function resolveWithExportMap({
|
|
717
723
|
preserveSymlinks,
|
718
724
|
useBrowserOverrides,
|
719
725
|
baseDir,
|
720
|
-
moduleDirectories
|
726
|
+
moduleDirectories,
|
727
|
+
modulePaths
|
721
728
|
});
|
722
729
|
}
|
723
730
|
});
|
@@ -767,6 +774,7 @@ async function resolveWithExportMap({
|
|
767
774
|
extensions,
|
768
775
|
includeCoreModules: false,
|
769
776
|
moduleDirectory: moduleDirectories,
|
777
|
+
paths: modulePaths,
|
770
778
|
preserveSymlinks,
|
771
779
|
packageFilter: filter
|
772
780
|
};
|
@@ -817,6 +825,7 @@ async function resolveWithClassic({
|
|
817
825
|
useBrowserOverrides,
|
818
826
|
baseDir,
|
819
827
|
moduleDirectories,
|
828
|
+
modulePaths,
|
820
829
|
rootDir,
|
821
830
|
ignoreSideEffectsForRoot
|
822
831
|
}) {
|
@@ -834,6 +843,7 @@ async function resolveWithClassic({
|
|
834
843
|
useBrowserOverrides,
|
835
844
|
baseDir,
|
836
845
|
moduleDirectories,
|
846
|
+
modulePaths,
|
837
847
|
rootDir,
|
838
848
|
ignoreSideEffectsForRoot
|
839
849
|
});
|
@@ -862,6 +872,7 @@ async function resolveImportSpecifiers({
|
|
862
872
|
useBrowserOverrides,
|
863
873
|
baseDir,
|
864
874
|
moduleDirectories,
|
875
|
+
modulePaths,
|
865
876
|
rootDir,
|
866
877
|
ignoreSideEffectsForRoot
|
867
878
|
}) {
|
@@ -877,6 +888,7 @@ async function resolveImportSpecifiers({
|
|
877
888
|
useBrowserOverrides,
|
878
889
|
baseDir,
|
879
890
|
moduleDirectories,
|
891
|
+
modulePaths,
|
880
892
|
rootDir,
|
881
893
|
ignoreSideEffectsForRoot
|
882
894
|
});
|
@@ -902,11 +914,44 @@ async function resolveImportSpecifiers({
|
|
902
914
|
useBrowserOverrides,
|
903
915
|
baseDir,
|
904
916
|
moduleDirectories,
|
917
|
+
modulePaths,
|
905
918
|
rootDir,
|
906
919
|
ignoreSideEffectsForRoot
|
907
920
|
});
|
908
921
|
}
|
909
922
|
|
923
|
+
const versionRegexp = /\^(\d+\.\d+\.\d+)/g;
|
924
|
+
|
925
|
+
function validateVersion(actualVersion, peerDependencyVersion) {
|
926
|
+
let minMajor = Infinity;
|
927
|
+
let minMinor = Infinity;
|
928
|
+
let minPatch = Infinity;
|
929
|
+
let foundVersion;
|
930
|
+
// eslint-disable-next-line no-cond-assign
|
931
|
+
while ((foundVersion = versionRegexp.exec(peerDependencyVersion))) {
|
932
|
+
const [foundMajor, foundMinor, foundPatch] = foundVersion[1].split('.').map(Number);
|
933
|
+
if (foundMajor < minMajor) {
|
934
|
+
minMajor = foundMajor;
|
935
|
+
minMinor = foundMinor;
|
936
|
+
minPatch = foundPatch;
|
937
|
+
}
|
938
|
+
}
|
939
|
+
if (!actualVersion) {
|
940
|
+
throw new Error(
|
941
|
+
`Insufficient Rollup version: "@rollup/plugin-node-resolve" requires at least rollup@${minMajor}.${minMinor}.${minPatch}.`
|
942
|
+
);
|
943
|
+
}
|
944
|
+
const [major, minor, patch] = actualVersion.split('.').map(Number);
|
945
|
+
if (
|
946
|
+
major < minMajor ||
|
947
|
+
(major === minMajor && (minor < minMinor || (minor === minMinor && patch < minPatch)))
|
948
|
+
) {
|
949
|
+
throw new Error(
|
950
|
+
`Insufficient rollup version: "@rollup/plugin-node-resolve" requires at least rollup@${minMajor}.${minMinor}.${minPatch} but found rollup@${actualVersion}.`
|
951
|
+
);
|
952
|
+
}
|
953
|
+
}
|
954
|
+
|
910
955
|
/* eslint-disable no-param-reassign, no-shadow, no-undefined */
|
911
956
|
|
912
957
|
const ES6_BROWSER_EMPTY = '\0node-resolve:empty.js';
|
@@ -940,7 +985,7 @@ function nodeResolve(opts = {}) {
|
|
940
985
|
const { warnings } = handleDeprecatedOptions(opts);
|
941
986
|
|
942
987
|
const options = { ...defaults, ...opts };
|
943
|
-
const { extensions, jail, moduleDirectories, ignoreSideEffectsForRoot } = options;
|
988
|
+
const { extensions, jail, moduleDirectories, modulePaths, ignoreSideEffectsForRoot } = options;
|
944
989
|
const conditionsEsm = [...baseConditionsEsm, ...(options.exportConditions || [])];
|
945
990
|
const conditionsCjs = [...baseConditionsCjs, ...(options.exportConditions || [])];
|
946
991
|
const packageInfoCache = new Map();
|
@@ -953,6 +998,12 @@ function nodeResolve(opts = {}) {
|
|
953
998
|
let { dedupe } = options;
|
954
999
|
let rollupOptions;
|
955
1000
|
|
1001
|
+
if (moduleDirectories.some((name) => name.includes('/'))) {
|
1002
|
+
throw new Error(
|
1003
|
+
'`moduleDirectories` option must only contain directory names. If you want to load modules from somewhere not supported by the default module resolution algorithm, see `modulePaths`.'
|
1004
|
+
);
|
1005
|
+
}
|
1006
|
+
|
956
1007
|
if (typeof dedupe !== 'function') {
|
957
1008
|
dedupe = (importee) =>
|
958
1009
|
options.dedupe.includes(importee) || options.dedupe.includes(getPackageName(importee));
|
@@ -1063,6 +1114,7 @@ function nodeResolve(opts = {}) {
|
|
1063
1114
|
useBrowserOverrides,
|
1064
1115
|
baseDir,
|
1065
1116
|
moduleDirectories,
|
1117
|
+
modulePaths,
|
1066
1118
|
rootDir,
|
1067
1119
|
ignoreSideEffectsForRoot
|
1068
1120
|
});
|
@@ -1138,6 +1190,7 @@ function nodeResolve(opts = {}) {
|
|
1138
1190
|
version,
|
1139
1191
|
|
1140
1192
|
buildStart(buildOptions) {
|
1193
|
+
validateVersion(this.meta.rollupVersion, peerDependencies.rollup);
|
1141
1194
|
rollupOptions = buildOptions;
|
1142
1195
|
|
1143
1196
|
for (const warning of warnings) {
|
@@ -1215,3 +1268,4 @@ function nodeResolve(opts = {}) {
|
|
1215
1268
|
}
|
1216
1269
|
|
1217
1270
|
export { DEFAULTS, nodeResolve as default, nodeResolve };
|
1271
|
+
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@rollup/plugin-node-resolve",
|
3
|
-
"version": "
|
3
|
+
"version": "15.0.0",
|
4
4
|
"publishConfig": {
|
5
5
|
"access": "public"
|
6
6
|
},
|
@@ -15,31 +15,32 @@
|
|
15
15
|
"bugs": "https://github.com/rollup/plugins/issues",
|
16
16
|
"main": "./dist/cjs/index.js",
|
17
17
|
"module": "./dist/es/index.js",
|
18
|
-
"type": "commonjs",
|
19
18
|
"exports": {
|
20
|
-
"
|
21
|
-
"import": "./dist/es/index.js"
|
19
|
+
"types": "./types/index.d.ts",
|
20
|
+
"import": "./dist/es/index.js",
|
21
|
+
"default": "./dist/cjs/index.js"
|
22
22
|
},
|
23
23
|
"engines": {
|
24
|
-
"node": ">=
|
24
|
+
"node": ">=14.0.0"
|
25
25
|
},
|
26
26
|
"scripts": {
|
27
27
|
"build": "rollup -c",
|
28
28
|
"ci:coverage": "nyc pnpm test && nyc report --reporter=text-lcov > coverage.lcov",
|
29
29
|
"ci:lint": "pnpm build && pnpm lint",
|
30
30
|
"ci:lint:commits": "commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}",
|
31
|
-
"ci:test": "pnpm test -- --verbose
|
31
|
+
"ci:test": "pnpm test -- --verbose",
|
32
32
|
"prebuild": "del-cli dist",
|
33
33
|
"prepare": "if [ ! -d 'dist' ]; then pnpm build; fi",
|
34
34
|
"prepublishOnly": "pnpm build",
|
35
35
|
"prerelease": "pnpm build",
|
36
36
|
"pretest": "pnpm build",
|
37
|
-
"release": "pnpm
|
38
|
-
"test": "
|
37
|
+
"release": "pnpm --workspace-root plugin:release --pkg $npm_package_name",
|
38
|
+
"test": "pnpm test:ts && ava",
|
39
39
|
"test:ts": "tsc types/index.d.ts test/types.ts --noEmit"
|
40
40
|
},
|
41
41
|
"files": [
|
42
42
|
"dist",
|
43
|
+
"!dist/**/*.map",
|
43
44
|
"types",
|
44
45
|
"README.md",
|
45
46
|
"LICENSE"
|
@@ -52,32 +53,35 @@
|
|
52
53
|
"modules"
|
53
54
|
],
|
54
55
|
"peerDependencies": {
|
55
|
-
"rollup": "^2.78.0"
|
56
|
+
"rollup": "^2.78.0||^3.0.0"
|
57
|
+
},
|
58
|
+
"peerDependenciesMeta": {
|
59
|
+
"rollup": {
|
60
|
+
"optional": true
|
61
|
+
}
|
56
62
|
},
|
57
63
|
"dependencies": {
|
58
|
-
"@rollup/pluginutils": "^
|
59
|
-
"@types/resolve": "1.
|
64
|
+
"@rollup/pluginutils": "^4.2.1",
|
65
|
+
"@types/resolve": "1.20.2",
|
60
66
|
"deepmerge": "^4.2.2",
|
61
|
-
"is-builtin-module": "^3.
|
67
|
+
"is-builtin-module": "^3.2.0",
|
62
68
|
"is-module": "^1.0.0",
|
63
|
-
"resolve": "^1.
|
69
|
+
"resolve": "^1.22.1"
|
64
70
|
},
|
65
71
|
"devDependencies": {
|
66
|
-
"@babel/core": "^7.
|
72
|
+
"@babel/core": "^7.19.1",
|
67
73
|
"@babel/plugin-transform-typescript": "^7.10.5",
|
68
74
|
"@rollup/plugin-babel": "^5.1.0",
|
69
75
|
"@rollup/plugin-commonjs": "^22.0.2",
|
70
76
|
"@rollup/plugin-json": "^4.1.0",
|
71
|
-
"es5-ext": "^0.10.
|
72
|
-
"rollup": "^
|
73
|
-
"source-map": "^0.7.
|
77
|
+
"es5-ext": "^0.10.62",
|
78
|
+
"rollup": "^3.0.0-7",
|
79
|
+
"source-map": "^0.7.4",
|
74
80
|
"string-capitalize": "^1.0.1"
|
75
81
|
},
|
76
|
-
"types": "types/index.d.ts",
|
82
|
+
"types": "./types/index.d.ts",
|
77
83
|
"ava": {
|
78
|
-
"
|
79
|
-
"compileEnhancements": false
|
80
|
-
},
|
84
|
+
"workerThreads": false,
|
81
85
|
"files": [
|
82
86
|
"!**/fixtures/**",
|
83
87
|
"!**/helpers/**",
|
package/types/index.d.ts
CHANGED
@@ -31,11 +31,18 @@ export interface RollupNodeResolveOptions {
|
|
31
31
|
browser?: boolean;
|
32
32
|
|
33
33
|
/**
|
34
|
-
*
|
34
|
+
* A list of directory names in which to recursively look for modules.
|
35
35
|
* @default ['node_modules']
|
36
36
|
*/
|
37
37
|
moduleDirectories?: string[];
|
38
38
|
|
39
|
+
/**
|
40
|
+
* A list of absolute paths to additional locations to search for modules.
|
41
|
+
* This is analogous to setting the `NODE_PATH` environment variable for node.
|
42
|
+
* @default []
|
43
|
+
*/
|
44
|
+
modulePaths?: string[];
|
45
|
+
|
39
46
|
/**
|
40
47
|
* An `Array` of modules names, which instructs the plugin to force resolving for the
|
41
48
|
* specified modules to the root `node_modules`. Helps to prevent bundling the same
|