mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-29 00:52:01 +00:00
fix(kit, nuxt): always sort globby results (#6029)
This commit is contained in:
parent
fa8b0f7c79
commit
b4b98041f0
@ -148,5 +148,5 @@ async function existsSensitive (path: string) {
|
|||||||
|
|
||||||
export async function resolveFiles (path: string, pattern: string | string[]) {
|
export async function resolveFiles (path: string, pattern: string | string[]) {
|
||||||
const files = await globby(pattern, { cwd: path, followSymbolicLinks: true })
|
const files = await globby(pattern, { cwd: path, followSymbolicLinks: true })
|
||||||
return files.map(p => resolve(path, p)).filter(p => !isIgnored(p))
|
return files.map(p => resolve(path, p)).filter(p => !isIgnored(p)).sort()
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,8 @@ export async function scanComponents (dirs: ComponentsDir[], srcDir: string): Pr
|
|||||||
// A map from resolved path to component name (used for making duplicate warning message)
|
// A map from resolved path to component name (used for making duplicate warning message)
|
||||||
const resolvedNames = new Map<string, string>()
|
const resolvedNames = new Map<string, string>()
|
||||||
|
|
||||||
for (const _file of await globby(dir.pattern!, { cwd: dir.path, ignore: dir.ignore })) {
|
const files = (await globby(dir.pattern!, { cwd: dir.path, ignore: dir.ignore })).sort()
|
||||||
|
for (const _file of files) {
|
||||||
const filePath = join(dir.path, _file)
|
const filePath = join(dir.path, _file)
|
||||||
|
|
||||||
if (scannedPaths.find(d => filePath.startsWith(d)) || isIgnored(filePath)) {
|
if (scannedPaths.find(d => filePath.startsWith(d)) || isIgnored(filePath)) {
|
||||||
|
@ -34,7 +34,7 @@ type Package = ThenArg<ReturnType<typeof loadPackage>>
|
|||||||
|
|
||||||
async function loadWorkspace (dir: string) {
|
async function loadWorkspace (dir: string) {
|
||||||
const workspacePkg = await loadPackage(dir)
|
const workspacePkg = await loadPackage(dir)
|
||||||
const pkgDirs = await globby(workspacePkg.data.workspaces || [], { onlyDirectories: true })
|
const pkgDirs = (await globby(workspacePkg.data.workspaces || [], { onlyDirectories: true })).sort()
|
||||||
|
|
||||||
const packages: Package[] = []
|
const packages: Package[] = []
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user