@@ -3,14 +3,12 @@ import fsP from 'node:fs/promises';
33import { platform } from 'node:os' ;
44import path , { join } from 'node:path' ;
55import { type RsbuildConfig , logger } from '@rsbuild/core' ;
6- import fg from 'fast-glob' ;
76import MagicString from 'magic-string' ;
87import color from 'picocolors' ;
8+ import { convertPathToPattern , glob } from 'tinyglobby' ;
99import ts from 'typescript' ;
1010import type { DtsEntry } from './index' ;
1111
12- const { convertPathToPattern } = fg ;
13-
1412export function loadTsconfig ( tsconfigPath : string ) : ts . ParsedCommandLine {
1513 const configFile = ts . readConfigFile ( tsconfigPath , ts . sys . readFile ) ;
1614 const configFileContent = ts . parseJsonConfigFileContent (
@@ -68,8 +66,8 @@ export const prettyTime = (seconds: number): string => {
6866 return `${ format ( minutes . toFixed ( 2 ) ) } m` ;
6967} ;
7068
71- // fast-glob only accepts posix path
72- // https://github.com/mrmlnc/fast-glob#convertpathtopatternpath
69+ // tinyglobby only accepts posix path
70+ // https://github.com/SuperchupuDev/tinyglobby?tab=readme-ov-file#api
7371const convertPath = ( path : string ) => {
7472 if ( platform ( ) === 'win32' ) {
7573 return convertPathToPattern ( path ) ;
@@ -111,7 +109,9 @@ export async function processDtsFiles(
111109 return ;
112110 }
113111
114- const dtsFiles = await fg ( convertPath ( join ( dir , '/**/*.d.ts' ) ) ) ;
112+ const dtsFiles = await glob ( convertPath ( join ( dir , '/**/*.d.ts' ) ) , {
113+ absolute : true ,
114+ } ) ;
115115
116116 for ( const file of dtsFiles ) {
117117 try {
0 commit comments