Skip to content

Commit 4559018

Browse files
committed
fix: escape special characters in glob patterns
1 parent 881f82d commit 4559018

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/core/options.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { ComponentResolver, ComponentResolverObject, Options, ResolvedOptio
22
import { join, resolve } from 'node:path'
33
import { slash, toArray } from '@antfu/utils'
44
import { getPackageInfoSync, isPackageExists } from 'local-pkg'
5+
import { escapePath } from 'tinyglobby'
56
import { detectTypeImports } from './type-imports/detect'
67

78
export const defaultOptions: Omit<Required<Options>, 'include' | 'exclude' | 'excludeNames' | 'transformer' | 'globs' | 'globsExclude' | 'directives' | 'types' | 'version'> = {
@@ -63,8 +64,8 @@ export function resolveOptions(options: Options, root: string): ResolvedOptions
6364
i = i.slice(1)
6465
}
6566
return resolved.deep
66-
? prefix + slash(join(i, `**/*.${extsGlob}`))
67-
: prefix + slash(join(i, `*.${extsGlob}`))
67+
? prefix + join(escapePath(i), `**/*.${extsGlob}`)
68+
: prefix + join(escapePath(i), `*.${extsGlob}`)
6869
})
6970

7071
if (!resolved.extensions.length)

0 commit comments

Comments
 (0)