Skip to content

Commit 5c49aaa

Browse files
committed
refactor: replace fast-glob with tinyglobby
Close #586
1 parent af58e76 commit 5c49aaa

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@
143143
"@vue/language-core": "^3.0.1",
144144
"ast-walker-scope": "^0.8.1",
145145
"chokidar": "^4.0.3",
146-
"fast-glob": "^3.3.3",
147146
"json5": "^2.2.3",
148147
"local-pkg": "^1.1.1",
149148
"magic-string": "^0.30.17",
@@ -152,6 +151,7 @@
152151
"pathe": "^2.0.3",
153152
"picomatch": "^4.0.2",
154153
"scule": "^1.3.0",
154+
"tinyglobby": "^0.2.14",
155155
"unplugin": "^2.3.5",
156156
"unplugin-utils": "^0.2.4",
157157
"yaml": "^2.8.0"

pnpm-lock.yaml

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/context.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { generateRouteNamedMap } from '../codegen/generateRouteMap'
66
import { generateRouteFileInfoMap } from '../codegen/generateRouteFileInfoMap'
77
import { MODULE_ROUTES_PATH, MODULE_VUE_ROUTER_AUTO } from './moduleConstants'
88
import { generateRouteRecord } from '../codegen/generateRouteRecords'
9-
import fg from 'fast-glob'
9+
import { glob } from 'tinyglobby'
1010
import { dirname, relative, resolve } from 'pathe'
1111
import { ServerContext } from '../options'
1212
import { getRouteBlock } from './customBlock'
@@ -74,11 +74,12 @@ export function createRoutesContext(options: ResolvedOptions) {
7474
f.startsWith('**') ? f : relative(folder.src, f)
7575
)
7676

77-
return fg(folder.pattern, {
77+
return glob(folder.pattern, {
7878
cwd: folder.src,
7979
// TODO: do they return the symbolic link path or the original file?
8080
// followSymbolicLinks: false,
8181
ignore: ignorePattern,
82+
expandDirectories: false,
8283
}).then((files) =>
8384
Promise.all(
8485
files

0 commit comments

Comments
 (0)