diff --git a/src/node/scan-dirs.ts b/src/node/scan-dirs.ts index 99a947e7..0e8198d7 100644 --- a/src/node/scan-dirs.ts +++ b/src/node/scan-dirs.ts @@ -15,9 +15,11 @@ const FileExtensionLookup = [ 'mts', 'cts', 'ts', + 'tsx', 'mjs', 'cjs', 'js', + 'jsx', ] const FileLookupPatterns = `*.{${FileExtensionLookup.join(',')}}` diff --git a/src/types.ts b/src/types.ts index 22bf6a26..4b4ddcb6 100644 --- a/src/types.ts +++ b/src/types.ts @@ -137,7 +137,7 @@ export interface Unimport { */ injectImports: (code: string | MagicString, id?: string, options?: InjectImportsOptions) => Promise - scanImportsFromDir: (dir?: string[], options?: ScanDirExportsOptions) => Promise + scanImportsFromDir: (dir?: (string | ScanDir)[], options?: ScanDirExportsOptions) => Promise scanImportsFromFile: (file: string, includeTypes?: boolean) => Promise /**