Skip to content

Commit 01d8379

Browse files
committed
revert #1055
1 parent de09ee1 commit 01d8379

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/cache.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
* @see https://github.com/babel/babel-loader/issues/34
99
* @see https://github.com/babel/babel-loader/pull/41
1010
*/
11-
const nodeModule = require("node:module");
1211
const os = require("os");
1312
const path = require("path");
1413
const zlib = require("zlib");
@@ -44,15 +43,6 @@ let defaultCacheDirectory = null;
4443
const gunzip = promisify(zlib.gunzip);
4544
const gzip = promisify(zlib.gzip);
4645

47-
const findRootPackageJSON = () => {
48-
if (nodeModule.findPackageJSON) {
49-
return nodeModule.findPackageJSON("..", __filename);
50-
} else {
51-
// todo: remove this fallback when dropping support for Node.js < 22.14
52-
return findUpSync("package.json");
53-
}
54-
};
55-
5646
/**
5747
* Read the contents from the compressed file.
5848
*
@@ -284,7 +274,7 @@ function findCacheDir(name) {
284274
if (env.CACHE_DIR && !["true", "false", "1", "0"].includes(env.CACHE_DIR)) {
285275
return path.join(env.CACHE_DIR, name);
286276
}
287-
const rootPkgJSONPath = findRootPackageJSON();
277+
const rootPkgJSONPath = findUpSync("package.json");
288278
if (rootPkgJSONPath) {
289279
return path.join(
290280
path.dirname(rootPkgJSONPath),

0 commit comments

Comments
 (0)