@@ -17,7 +17,7 @@ import {
1717import { sep , join } from 'pathe'
1818import { findUp as internalFindUp , findUpSync as internalFindUpSync } from 'find-up'
1919import { minimatch } from 'minimatch'
20- import { createRequire } from 'module '
20+ import fastGlobLib from 'fast-glob '
2121import {
2222 mkdirSync as fsMkdirSync ,
2323 readFileSync as fsReadFileSync ,
@@ -33,6 +33,7 @@ import {
3333 accessSync ,
3434 ReadStream ,
3535 WriteStream ,
36+ statSync ,
3637} from 'fs'
3738
3839import {
@@ -57,8 +58,6 @@ import * as os from 'os'
5758
5859import type { Pattern , Options as GlobOptions } from 'fast-glob'
5960
60- const require = createRequire ( import . meta. url )
61-
6261/**
6362 * Strip the first `strip` parts of the path.
6463 *
@@ -511,7 +510,7 @@ export function unixFileIsOwnedByCurrentUser(path: string): boolean | undefined
511510 if ( ! fileExistsSync ( path ) ) return false
512511
513512 try {
514- const stats = fsStatSync ( path )
513+ const stats = statSync ( path )
515514 const currentUid = process . getuid ( )
516515
517516 return stats . uid === currentUid
@@ -595,13 +594,11 @@ export async function glob(pattern: Pattern | Pattern[], options?: GlobOptions):
595594 * @returns An array of pathnames that match the given pattern.
596595 */
597596export function globSync ( pattern : Pattern | Pattern [ ] , options ?: GlobOptions ) : string [ ] {
598- // Performance: fast-glob is a heavy dependency. We lazy-load it here to avoid
599- // overhead during CLI startup for commands that don't need globbing.
600597 let overridenOptions = options
601598 if ( options ?. dot == null ) {
602599 overridenOptions = { ...options , dot : true }
603600 }
604- return ( require ( 'fast-glob' ) as typeof import ( 'fast-glob' ) ) . sync ( pattern , overridenOptions )
601+ return fastGlobLib . sync ( pattern , overridenOptions )
605602}
606603
607604/**
0 commit comments