Skip to content

Commit

Permalink
fix: let glob match alphabetical order
Browse files Browse the repository at this point in the history
  • Loading branch information
younggglcy committed May 27, 2024
1 parent 677a88d commit 44dffaf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/commonjs/src/dynamic-modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ export function getDynamicRequireModules(patterns, dynamicRequireRoot) {
isNegated
? dynamicRequireModules.delete(targetPath)
: dynamicRequireModules.set(targetPath, resolvedPath);
for (const path of glob.sync(isNegated ? pattern.substr(1) : pattern)) {
for (const path of glob
.sync(isNegated ? pattern.substr(1) : pattern)
.sort((a, b) => a.localeCompare(b, 'en'))) {
const resolvedPath = resolve(path);
const requirePath = normalizePathSlashes(resolvedPath);
if (isDirectory(resolvedPath)) {
Expand Down

0 comments on commit 44dffaf

Please sign in to comment.