File tree Expand file tree Collapse file tree 1 file changed +1
-11
lines changed
Expand file tree Collapse file tree 1 file changed +1
-11
lines changed Original file line number Diff line number Diff line change 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" ) ;
1211const os = require ( "os" ) ;
1312const path = require ( "path" ) ;
1413const zlib = require ( "zlib" ) ;
@@ -44,15 +43,6 @@ let defaultCacheDirectory = null;
4443const gunzip = promisify ( zlib . gunzip ) ;
4544const 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 ) ,
You can’t perform that action at this time.
0 commit comments