Skip to content

Commit ecd596f

Browse files
committed
perf: use native filter
1 parent adde2be commit ecd596f

File tree

5 files changed

+95
-9
lines changed

5 files changed

+95
-9
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"build": "tsdown",
5959
"dev": "tsdown --watch",
6060
"test": "vitest",
61-
"typecheck": "tsc --noEmit",
61+
"typecheck": "tsgo --noEmit",
6262
"release": "bumpp",
6363
"prepublishOnly": "pnpm run build"
6464
},
@@ -91,6 +91,7 @@
9191
"@sxzz/prettier-config": "^2.2.6",
9292
"@sxzz/test-utils": "^0.5.14",
9393
"@types/node": "^25.0.2",
94+
"@typescript/native-preview": "7.0.0-dev.20251215.1",
9495
"bumpp": "^10.3.2",
9596
"esbuild": "^0.27.1",
9697
"eslint": "^9.39.2",

pnpm-lock.yaml

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

pnpm-workspace.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
ignoredBuiltDependencies:
2+
- '@swc/core'
3+
- core-js
4+
- esbuild

src/core/options.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { IsolatedDeclarationsOptions } from 'oxc-transform'
22
import type { TranspileOptions } from 'typescript'
3-
import type { FilterPattern } from 'unplugin-utils'
3+
import type { FilterPattern } from 'unplugin'
44

55
/**
66
* Represents the options for the plugin.

src/index.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,16 @@ export const IsolatedDecl: UnpluginInstance<Options | undefined, false> =
8787
outputFiles = Object.create(null)
8888
},
8989

90-
transformInclude: (id) => filter(id),
91-
transform(code, id): Promise<undefined> {
92-
return transform(this, code, id)
90+
transform: {
91+
filter: {
92+
id: {
93+
include: options.include,
94+
exclude: options.exclude,
95+
},
96+
},
97+
handler(code, id): Promise<undefined> {
98+
return transform(this, code, id)
99+
},
93100
},
94101

95102
esbuild: { setup: esbuildSetup },

0 commit comments

Comments
 (0)