File tree Expand file tree Collapse file tree 1 file changed +1
-14
lines changed
packages/vite/src/node/plugins Expand file tree Collapse file tree 1 file changed +1
-14
lines changed Original file line number Diff line number Diff line change 11import path from 'node:path'
22import url from 'node:url'
3- import { createRequire } from 'node:module'
43import type {
54 TransformOptions as OxcTransformOptions ,
65 TransformResult as OxcTransformResult ,
@@ -526,23 +525,11 @@ export function resolveOxcTranspileOptions(
526525 }
527526}
528527
529- let viteDir : string
530- function getViteDir ( ) {
531- if ( ! viteDir ) {
532- let dir = createRequire ( import . meta. url ) . resolve ( 'vite' )
533- while ( dir && path . basename ( dir ) !== 'vite' ) {
534- dir = path . dirname ( dir )
535- }
536- viteDir = dir
537- }
538- return viteDir
539- }
540-
541528async function generateRuntimeHelpers (
542529 runtimeHelpers : readonly [ string , string ] [ ] ,
543530) : Promise < string > {
544531 const bundle = await rolldown ( {
545- cwd : getViteDir ( ) ,
532+ cwd : url . fileURLToPath ( import . meta . url ) ,
546533 input : 'entrypoint' ,
547534 platform : 'neutral' ,
548535 logLevel : 'silent' ,
You can’t perform that action at this time.
0 commit comments