Skip to content

Commit 9431d75

Browse files
committed
chore: update default options
1 parent ab6cf7a commit 9431d75

File tree

3 files changed

+35
-14
lines changed

3 files changed

+35
-14
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
"dist"
3333
],
3434
"scripts": {
35-
"test": "vitest",
3635
"build": "tsup",
3736
"prepare": "npx simple-git-hooks",
3837
"lint": "eslint .",

pnpm-lock.yaml

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,32 @@
1-
import process from 'node:process'
1+
import { cwd } from 'node:process'
22
import type { NapiResolveOptions } from 'oxc-resolver'
33
import { ResolverFactory } from 'oxc-resolver'
44

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+
],
715
conditionNames: [
16+
'default',
817
'types',
9-
'import',
10-
// APF: https://angular.io/guide/angular-package-format
11-
'esm2020',
12-
'es2020',
13-
'es2015',
1418

19+
'import',
1520
'require',
21+
1622
'node',
1723
'node-addons',
1824
'browser',
19-
'default',
25+
26+
// APF: https://angular.io/guide/angular-package-format
27+
'esm2020',
28+
'es2020',
29+
'es2015',
2030
],
2131
extensionAlias: {
2232
'.js': [
@@ -49,13 +59,12 @@ const defaultOptions = {
4959
'esm2020',
5060
'es2020',
5161

62+
'main',
5263
'module',
64+
'browser',
5365
'jsnext:main',
54-
55-
'main',
5666
],
57-
preferRelative: true,
58-
roots: [process.cwd()],
67+
roots: [cwd()],
5968
}
6069

6170
let resolver: ResolverFactory | undefined

0 commit comments

Comments
 (0)