Skip to content

Commit b9e008c

Browse files
authored
fix: transform ts locale files with esbuild (#3428)
* fix: transform ts locale files including their imports using `esbuild` * test: add ts locale file with type annotation
1 parent 258b179 commit b9e008c

6 files changed

Lines changed: 138 additions & 60 deletions

File tree

build.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export default defineBuildConfig({
77
'node:url',
88
'webpack',
99
'@rspack/core',
10+
'oxc-parser',
1011
'@babel/parser',
1112
'unplugin-vue-router',
1213
'unplugin-vue-router/options'

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,13 @@
108108
"@vue/compiler-sfc": "^3.5.13",
109109
"debug": "^4.3.5",
110110
"defu": "^6.1.4",
111+
"esbuild": "^0.25.1",
111112
"estree-walker": "^3.0.3",
112113
"is-https": "^4.0.0",
113114
"knitwork": "^1.2.0",
114115
"magic-string": "^0.30.17",
115116
"mlly": "^1.7.4",
116-
"oxc-parser": "^0.53.0",
117+
"oxc-parser": "^0.61.0",
117118
"pathe": "^2.0.3",
118119
"ufo": "^1.5.4",
119120
"unplugin": "^2.2.1",

pnpm-lock.yaml

Lines changed: 98 additions & 58 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default defineI18nLocale(
2+
() =>
3+
({
4+
'server-key': 'Hello!'
5+
}) as Record<string, string> // types should be stripped during transformation
6+
)

0 commit comments

Comments
 (0)