Skip to content

Commit f57a50d

Browse files
committed
test-window-path
1 parent 59a2a90 commit f57a50d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
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(slash(i)), `**/*.${extsGlob}`))
68+
: prefix + (join(escapePath(slash(i)), `*.${extsGlob}`))
6869
})
6970

7071
if (!resolved.extensions.length)

test/search.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe('search', () => {
1818
ctx.setRoot(root)
1919
ctx.searchGlob()
2020

21-
expect(ctx.options.globs).toMatchSnapshot()
21+
expect(ctx.options.globs).toMatch('D:/a/unplugin-vue-components/unplugin-vue-components/examples/vite-vue3/src/components/**/*.vue')
2222
expect(cleanup(ctx.componentNameMap)).toMatchSnapshot()
2323
})
2424

0 commit comments

Comments
 (0)