File tree Expand file tree Collapse file tree 4 files changed +18
-9
lines changed
babel-core/src/config/files Expand file tree Collapse file tree 4 files changed +18
-9
lines changed Original file line number Diff line number Diff line change 65
65
"gulp-filter" : " ^7.0.0" ,
66
66
"gulp-plumber" : " ^1.2.1" ,
67
67
"husky" : " ^8.0.3" ,
68
- "import-meta-resolve" : " ^3 .0.0" ,
68
+ "import-meta-resolve" : " ^4 .0.0" ,
69
69
"is-ci" : " ^3.0.1" ,
70
70
"jest" : " ^30.0.0-alpha.1" ,
71
71
"jest-light-runner" : " ^0.6.0-alpha.1" ,
Original file line number Diff line number Diff line change 20
20
"chalk" : " condition:BABEL_8_BREAKING ? ^5.3.0 : ^2.4.2 (esm:default|Chalk)"
21
21
},
22
22
"devDependencies" : {
23
- "import-meta-resolve" : " ^3 .0.0" ,
23
+ "import-meta-resolve" : " ^4 .0.0" ,
24
24
"strip-ansi" : " ^4.0.0"
25
25
},
26
26
"engines" : {
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import { fileURLToPath, pathToFileURL } from "url";
12
12
import { resolve as importMetaResolve } from "../../vendor/import-meta-resolve.js" ;
13
13
14
14
import { createRequire } from "module" ;
15
+ import { existsSync } from "fs" ;
15
16
const require = createRequire ( import . meta. url ) ;
16
17
17
18
const debug = buildDebug ( "babel:config:loading:files:plugins" ) ;
@@ -196,7 +197,15 @@ function resolveStandardizedName(
196
197
}
197
198
198
199
try {
199
- return resolveStandardizedNameForImport ( type , name , dirname ) ;
200
+ const resolved = resolveStandardizedNameForImport ( type , name , dirname ) ;
201
+ // import-meta-resolve 4.0 does not throw if the module is not found.
202
+ if ( ! existsSync ( resolved ) ) {
203
+ throw Object . assign (
204
+ new Error ( `Could not resolve "${ name } " in file ${ dirname } .` ) ,
205
+ { type : "MODULE_NOT_FOUND" } ,
206
+ ) ;
207
+ }
208
+ return resolved ;
200
209
} catch ( e ) {
201
210
try {
202
211
return resolveStandardizedNameForRequire ( type , name , dirname ) ;
Original file line number Diff line number Diff line change @@ -293,7 +293,7 @@ __metadata:
293
293
dependencies:
294
294
"@babel/highlight": "workspace:^"
295
295
chalk: "condition:BABEL_8_BREAKING ? ^5.3.0 : ^2.4.2 (esm:default|Chalk)"
296
- import-meta-resolve: "npm:^3 .0.0"
296
+ import-meta-resolve: "npm:^4 .0.0"
297
297
strip-ansi: "npm:^4.0.0"
298
298
languageName: unknown
299
299
linkType: soft
@@ -6808,7 +6808,7 @@ __metadata:
6808
6808
gulp-filter: "npm:^7.0.0"
6809
6809
gulp-plumber: "npm:^1.2.1"
6810
6810
husky: "npm:^8.0.3"
6811
- import-meta-resolve: "npm:^3 .0.0"
6811
+ import-meta-resolve: "npm:^4 .0.0"
6812
6812
is-ci: "npm:^3.0.1"
6813
6813
jest: "npm:^30.0.0-alpha.1"
6814
6814
jest-light-runner: "npm:^0.6.0-alpha.1"
@@ -10626,10 +10626,10 @@ __metadata:
10626
10626
languageName: node
10627
10627
linkType: hard
10628
10628
10629
- "import-meta-resolve@npm:^3 .0.0":
10630
- version: 3 .0.0
10631
- resolution: "import-meta-resolve@npm:3 .0.0"
10632
- checksum: f50697d21c5e4ed00425fc756a84deaf8911954786ce1639874ed6e85565bbecda738dc7554f56f70594bca5c6d67cb329912f97adf4288d216e143f07d6af43
10629
+ "import-meta-resolve@npm:^4 .0.0":
10630
+ version: 4 .0.0
10631
+ resolution: "import-meta-resolve@npm:4 .0.0"
10632
+ checksum: 73f0f1d68f7280cb4415e3a212a6e5d57fbfe61ab6f467df3dad5361529fbd89ac7d8ea2b694412b74985a4226d218ad3fb22fd8f06f5429beda521dc9f0229c
10633
10633
languageName: node
10634
10634
linkType: hard
10635
10635
You can’t perform that action at this time.
0 commit comments