Skip to content

Commit e819f96

Browse files
hyf0claudesxzz
authored
fix: exclude rolldown runtime from transform hook (#178)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: Kevin Deng <sxzz@sxzz.moe>
1 parent 8cbe51a commit e819f96

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

dts.snapshot.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"RE_JS": "RegExp",
1818
"RE_JSON": "RegExp",
1919
"RE_NODE_MODULES": "RegExp",
20+
"RE_ROLLDOWN_RUNTIME": "RegExp",
2021
"RE_TS": "RegExp",
2122
"RE_VUE": "RegExp",
2223
"replaceTemplateName": "declare function replaceTemplateName(_: string, _: string): string",
@@ -28,6 +29,7 @@
2829
"RE_JS",
2930
"RE_JSON",
3031
"RE_NODE_MODULES",
32+
"RE_ROLLDOWN_RUNTIME",
3133
"RE_TS",
3234
"RE_VUE",
3335
"filename_dts_to",

src/filename.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export const RE_NODE_MODULES: RegExp = /[\\/]node_modules[\\/]/
88
export const RE_CSS: RegExp = /\.css$/
99
export const RE_VUE: RegExp = /\.vue$/
1010
export const RE_JSON: RegExp = /\.json$/
11+
export const RE_ROLLDOWN_RUNTIME: RegExp = /^\0rolldown\/runtime\.js$/
1112

1213
export function filename_js_to_dts(id: string): string {
1314
return id.replace(RE_JS, '.d.$1ts')

src/generate.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
RE_JS,
1313
RE_JSON,
1414
RE_NODE_MODULES,
15+
RE_ROLLDOWN_RUNTIME,
1516
RE_TS,
1617
RE_VUE,
1718
replaceTemplateName,
@@ -176,7 +177,7 @@ export function createGeneratePlugin({
176177
filter: {
177178
id: {
178179
include: [RE_JS, RE_TS, RE_VUE, RE_JSON],
179-
exclude: [RE_DTS, RE_NODE_MODULES],
180+
exclude: [RE_DTS, RE_NODE_MODULES, RE_ROLLDOWN_RUNTIME],
180181
},
181182
},
182183
handler(code, id) {

0 commit comments

Comments
 (0)