@@ -7,15 +7,14 @@ import { transformSync } from 'rolldown/utils'
77import { viteTransformPlugin as nativeTransformPlugin } from 'rolldown/experimental'
88import type { RolldownError , RolldownLog , SourceMap } from 'rolldown'
99import colors from 'picocolors'
10- import { prefixRegex } from 'rolldown/filter'
1110import type { FSWatcher } from '#dep-types/chokidar'
1211import { createFilter , ensureWatchedFile , normalizePath } from '../utils'
1312import type { ResolvedConfig } from '../config'
1413import type { Plugin } from '../plugin'
1514import { cleanUrl } from '../../shared/utils'
1615import { type Environment , perEnvironmentPlugin } from '..'
1716import type { ViteDevServer } from '../server'
18- import { JS_TYPES_RE , VITE_PACKAGE_DIR } from '../constants'
17+ import { JS_TYPES_RE } from '../constants'
1918import type { Logger } from '../logger'
2019import { type ESBuildOptions , getTSConfigResolutionCache } from './esbuild'
2120
@@ -299,9 +298,6 @@ export function oxcPlugin(config: ResolvedConfig): Plugin {
299298
300299 return result
301300 }
302- const runtimeResolveBase = normalizePath (
303- path . join ( VITE_PACKAGE_DIR , 'package.json' ) ,
304- )
305301
306302 let server : ViteDevServer
307303
@@ -310,23 +306,6 @@ export function oxcPlugin(config: ResolvedConfig): Plugin {
310306 configureServer ( _server ) {
311307 server = _server
312308 } ,
313- // @oxc -project/runtime resolution is handled by rolldown in build
314- ...( config . command === 'serve'
315- ? {
316- resolveId : {
317- filter : {
318- id : prefixRegex ( '@oxc-project/runtime/' ) ,
319- } ,
320- async handler ( id , _importer , opts ) {
321- // @oxc -project/runtime imports will be injected by Oxc transform
322- // since it's injected by the transform, @oxc-project/runtime should be resolved to the one Vite depends on
323- const resolved = await this . resolve ( id , runtimeResolveBase , opts )
324- return resolved
325- } ,
326- order : 'pre' ,
327- } ,
328- }
329- : { } ) ,
330309 async transform ( code , id ) {
331310 if ( filter ( id ) || filter ( cleanUrl ( id ) ) || jsxRefreshFilter ?.( id ) ) {
332311 const modifiedOxcTransformOptions = getModifiedOxcTransformOptions (
0 commit comments