File tree Expand file tree Collapse file tree 3 files changed +35
-14
lines changed Expand file tree Collapse file tree 3 files changed +35
-14
lines changed Original file line number Diff line number Diff line change 32
32
" dist"
33
33
],
34
34
"scripts" : {
35
- "test" : " vitest" ,
36
35
"build" : " tsup" ,
37
36
"prepare" : " npx simple-git-hooks" ,
38
37
"lint" : " eslint ." ,
Original file line number Diff line number Diff line change 1
- import process from 'node:process'
1
+ import { cwd } from 'node:process'
2
2
import type { NapiResolveOptions } from 'oxc-resolver'
3
3
import { ResolverFactory } from 'oxc-resolver'
4
4
5
- // some default options copy from https://github.com/import-js/eslint-import-resolver-typescript/blob/master/src/index.ts
6
- const defaultOptions = {
5
+ // @keep -sorted
6
+ /**
7
+ * some default options copy from
8
+ * https://github.com/import-js/eslint-import-resolver-typescript/blob/master/src/index.ts
9
+ * https://github.com/rolldown/rolldown/blob/main/crates/rolldown_resolver/src/resolver.rs
10
+ */
11
+ const defaultOptions : NapiResolveOptions = {
12
+ aliasFields : [
13
+ [ 'browser' ] ,
14
+ ] ,
7
15
conditionNames : [
16
+ 'default' ,
8
17
'types' ,
9
- 'import' ,
10
- // APF: https://angular.io/guide/angular-package-format
11
- 'esm2020' ,
12
- 'es2020' ,
13
- 'es2015' ,
14
18
19
+ 'import' ,
15
20
'require' ,
21
+
16
22
'node' ,
17
23
'node-addons' ,
18
24
'browser' ,
19
- 'default' ,
25
+
26
+ // APF: https://angular.io/guide/angular-package-format
27
+ 'esm2020' ,
28
+ 'es2020' ,
29
+ 'es2015' ,
20
30
] ,
21
31
extensionAlias : {
22
32
'.js' : [
@@ -49,13 +59,12 @@ const defaultOptions = {
49
59
'esm2020' ,
50
60
'es2020' ,
51
61
62
+ 'main' ,
52
63
'module' ,
64
+ 'browser' ,
53
65
'jsnext:main' ,
54
-
55
- 'main' ,
56
66
] ,
57
- preferRelative : true ,
58
- roots : [ process . cwd ( ) ] ,
67
+ roots : [ cwd ( ) ] ,
59
68
}
60
69
61
70
let resolver : ResolverFactory | undefined
You can’t perform that action at this time.
0 commit comments