Skip to content

Commit da10b97

Browse files
authored
chore: switch to tinyglobby (#511)
1 parent 55ad5a8 commit da10b97

File tree

4 files changed

+122
-67
lines changed

4 files changed

+122
-67
lines changed

packages/unplugin-vue-i18n/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
"@rollup/pluginutils": "^5.1.0",
3030
"debug": "^4.3.3",
3131
"defu": "^6.1.4",
32-
"fast-glob": "^3.2.12",
3332
"knitwork": "^1.2.0",
3433
"mlly": "^1.2.0",
3534
"picocolors": "^1.0.0",
35+
"tinyglobby": "^0.2.15",
3636
"unplugin": "^2.2.0",
3737
"vue": "catalog:vue"
3838
},

packages/unplugin-vue-i18n/src/core/resource.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
import { assign, generateCodeFrame, isEmptyObject } from '@intlify/shared'
99
import { createFilter } from '@rollup/pluginutils'
1010
import createDebug from 'debug'
11-
import fg from 'fast-glob'
11+
import { globSync } from 'tinyglobby'
1212
import { genImport, genSafeVariableName } from 'knitwork'
1313
import { findStaticImports } from 'mlly'
1414
import { createHash } from 'node:crypto'
@@ -60,7 +60,7 @@ export function resourcePlugin(opts: ResolvedOptions, meta: UnpluginContextMeta)
6060

6161
const resourcePaths = new Set<string>()
6262
for (const inc of opts.include || []) {
63-
for (const resourcePath of fg.sync(inc, { ignore: opts.exclude })) {
63+
for (const resourcePath of globSync(inc, { ignore: opts.exclude, expandDirectories: false })) {
6464
resourcePaths.add(resourcePath)
6565
}
6666
}

packages/unplugin-vue-i18n/test/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { isBoolean, isString } from '@intlify/shared'
22
import vue from '@vitejs/plugin-vue'
3-
import fg from 'fast-glob'
3+
import { glob } from 'tinyglobby'
44
import { JSDOM, VirtualConsole } from 'jsdom'
55
import memoryfs from 'memory-fs'
66
import { dirname, resolve } from 'node:path'
@@ -54,7 +54,7 @@ async function bundleVite(
5454
}
5555

5656
if (ignoreIds == null) {
57-
ignoreIds = await fg(resolve(__dirname, './fixtures/directives/*.vue'))
57+
ignoreIds = await glob(resolve(__dirname, './fixtures/directives/*.vue'), { expandDirectories: false })
5858
}
5959

6060
// @ts-ignore

0 commit comments

Comments
 (0)