Skip to content

Commit

Permalink
chore: using oxc transform
Browse files Browse the repository at this point in the history
  • Loading branch information
underfin committed Dec 16, 2024
1 parent 70e94ed commit 6ef8d05
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/plugin-vue-jsx/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function vueJsxPlugin(options: Options = {}): Plugin {
return {
// only apply esbuild to ts files
// since we are handling jsx and tsx now
esbuild: {
oxc: {
include: /\.ts$/,
},
define: {
Expand Down
9 changes: 5 additions & 4 deletions packages/plugin-vue/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { EncodedSourceMap as TraceEncodedSourceMap } from '@jridgewell/trac
import { TraceMap, eachMapping } from '@jridgewell/trace-mapping'
import type { EncodedSourceMap as GenEncodedSourceMap } from '@jridgewell/gen-mapping'
import { addMapping, fromMap, toEncodedMap } from '@jridgewell/gen-mapping'
import { normalizePath, transformWithEsbuild } from 'rolldown-vite'
import { normalizePath, transformWithOxc } from 'rolldown-vite'
import {
createDescriptor,
getDescriptor,
Expand Down Expand Up @@ -256,15 +256,16 @@ export async function transformMain(
/tsx?$/.test(lang) &&
!descriptor.script?.src // only normal script can have src
) {
const { code, map } = await transformWithEsbuild(
const { code, map } = await transformWithOxc(
pluginContext,
resolvedCode,
filename,
{
target: 'esnext',
// #430 support decorators in .vue file
// target can be overridden by esbuild config target
...options.devServer?.config.esbuild,
loader: 'ts',
...options.devServer?.config.oxc,
lang: 'ts',
sourcemap: options.sourceMap,
},
resolvedMap,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ exports[`serve:vue-sourcemap > src imported sass > serve-src-imported-sass 1`] =
exports[`serve:vue-sourcemap > ts > serve-ts 1`] = `
{
"ignoreList": [],
"mappings": ";AAKA,QAAQ,IAAI,WAAW;;;;;AAIvB,YAAQ,IAAI,UAAU;;;;;;;;uBARpB,oBAAiB,WAAd,MAAU",
"mappings": ";AAKA,QAAQ,IAAI,YAAW;;;;;AAIvB,UAAQ,IAAI,WAAU;;;;;;;;;;;sBARpB,oBAAiB,WAAd,OAAU",
"sources": [
"Ts.vue",
],
Expand Down

0 comments on commit 6ef8d05

Please sign in to comment.