File tree 3 files changed +19
-5
lines changed
3 files changed +19
-5
lines changed Original file line number Diff line number Diff line change 65
65
"peerDependencies" : {
66
66
"eslint" : " *" ,
67
67
"eslint-plugin-import" : " *" ,
68
- "eslint-plugin-import-x" : " *"
68
+ "eslint-plugin-import-x" : " *" ,
69
+ "is-bun-module" : " *"
69
70
},
70
71
"peerDependenciesMeta" : {
71
72
"eslint-plugin-import" : {
72
73
"optional" : true
73
74
},
74
75
"eslint-plugin-import-x" : {
75
76
"optional" : true
77
+ },
78
+ "is-bun-module" : {
79
+ "optional" : true
76
80
}
77
81
},
78
82
"dependencies" : {
79
83
"debug" : " ^4.4.0" ,
80
84
"get-tsconfig" : " ^4.10.0" ,
81
- "is-bun-module" : " ^1.3.0" ,
82
85
"rspack-resolver" : " ^1.1.2" ,
83
86
"stable-hash" : " ^0.0.5" ,
84
87
"tinyglobby" : " ^0.2.12"
100
103
"eslint" : " ^9.22.0" ,
101
104
"eslint-import-resolver-typescript" : " link:." ,
102
105
"eslint-plugin-import-x" : " ^4.8.0" ,
106
+ "is-bun-module" : " ^1.3.0" ,
103
107
"lint-staged" : " ^15.5.0" ,
104
108
"npm-run-all2" : " ^7.0.2" ,
105
109
"prettier" : " ^3.5.3" ,
Original file line number Diff line number Diff line change 8
8
createFilesMatcher ,
9
9
parseTsconfig ,
10
10
} from 'get-tsconfig'
11
- import { type Version , isBunModule , isSupportedNodeModule } from 'is-bun-module'
11
+ import { type Version } from 'is-bun-module'
12
12
import { ResolverFactory } from 'rspack-resolver'
13
13
import { stableHash } from 'stable-hash'
14
14
@@ -53,6 +53,11 @@ const oxcResolve = (
53
53
}
54
54
}
55
55
56
+ type IsBunModule = typeof import ( 'is-bun-module' )
57
+ let isBunModule : IsBunModule | undefined
58
+
59
+ const _filename = typeof __filename === 'string' ? __filename : import . meta. url
60
+
56
61
export const resolve = (
57
62
source : string ,
58
63
file : string ,
@@ -69,8 +74,10 @@ export const resolve = (
69
74
if (
70
75
bunVersion
71
76
? module . isBuiltin ( source )
72
- : isBunModule ( source , ( bunVersion = 'latest' ) ) ||
73
- isSupportedNodeModule ( source , bunVersion )
77
+ : ( isBunModule ??= module . createRequire ( _filename ) (
78
+ 'is-bun-module' ,
79
+ ) as IsBunModule ) . isBunModule ( source , ( bunVersion = 'latest' ) ) ||
80
+ isBunModule . isSupportedNodeModule ( source , bunVersion )
74
81
) {
75
82
log ( 'matched bun core:' , source )
76
83
return { found : true , path : null }
Original file line number Diff line number Diff line change @@ -6715,11 +6715,14 @@ __metadata:
6715
6715
eslint: "*"
6716
6716
eslint-plugin-import: "*"
6717
6717
eslint-plugin-import-x: "*"
6718
+ is-bun-module: "*"
6718
6719
peerDependenciesMeta:
6719
6720
eslint-plugin-import:
6720
6721
optional: true
6721
6722
eslint-plugin-import-x:
6722
6723
optional: true
6724
+ is-bun-module:
6725
+ optional: true
6723
6726
languageName: unknown
6724
6727
linkType: soft
6725
6728
You can’t perform that action at this time.
0 commit comments