File tree 1 file changed +1
-14
lines changed
packages/vite/src/node/plugins
1 file changed +1
-14
lines changed Original file line number Diff line number Diff line change 1
1
import path from 'node:path'
2
2
import url from 'node:url'
3
- import { createRequire } from 'node:module'
4
3
import type {
5
4
TransformOptions as OxcTransformOptions ,
6
5
TransformResult as OxcTransformResult ,
@@ -526,23 +525,11 @@ export function resolveOxcTranspileOptions(
526
525
}
527
526
}
528
527
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
-
541
528
async function generateRuntimeHelpers (
542
529
runtimeHelpers : readonly [ string , string ] [ ] ,
543
530
) : Promise < string > {
544
531
const bundle = await rolldown ( {
545
- cwd : getViteDir ( ) ,
532
+ cwd : url . fileURLToPath ( import . meta . url ) ,
546
533
input : 'entrypoint' ,
547
534
platform : 'neutral' ,
548
535
logLevel : 'silent' ,
You can’t perform that action at this time.
0 commit comments