|
1 | 1 | import path from 'node:path'
|
2 | 2 | import fs from 'node:fs'
|
3 | 3 | import type { SFCBlock, SFCDescriptor } from 'vue/compiler-sfc'
|
4 |
| -import type { PluginContext, TransformPluginContext } from 'rollup' |
| 4 | +import type { PluginContext, TransformPluginContext } from 'rolldown' |
5 | 5 | import type { RawSourceMap } from 'source-map-js'
|
6 | 6 | import type { EncodedSourceMap as TraceEncodedSourceMap } from '@jridgewell/trace-mapping'
|
7 | 7 | import { TraceMap, eachMapping } from '@jridgewell/trace-mapping'
|
8 | 8 | import type { EncodedSourceMap as GenEncodedSourceMap } from '@jridgewell/gen-mapping'
|
9 | 9 | import { addMapping, fromMap, toEncodedMap } from '@jridgewell/gen-mapping'
|
10 |
| -import { normalizePath, transformWithEsbuild } from 'vite' |
| 10 | +import { normalizePath, transformWithOxc } from 'rolldown-vite' |
11 | 11 | import {
|
12 | 12 | createDescriptor,
|
13 | 13 | getDescriptor,
|
@@ -256,15 +256,16 @@ export async function transformMain(
|
256 | 256 | /tsx?$/.test(lang) &&
|
257 | 257 | !descriptor.script?.src // only normal script can have src
|
258 | 258 | ) {
|
259 |
| - const { code, map } = await transformWithEsbuild( |
| 259 | + const { code, map } = await transformWithOxc( |
| 260 | + pluginContext, |
260 | 261 | resolvedCode,
|
261 | 262 | filename,
|
262 | 263 | {
|
263 | 264 | target: 'esnext',
|
264 | 265 | // #430 support decorators in .vue file
|
265 | 266 | // target can be overridden by esbuild config target
|
266 |
| - ...options.devServer?.config.esbuild, |
267 |
| - loader: 'ts', |
| 267 | + ...options.devServer?.config.oxc, |
| 268 | + lang: 'ts', |
268 | 269 | sourcemap: options.sourceMap,
|
269 | 270 | },
|
270 | 271 | resolvedMap,
|
|
0 commit comments