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 Jun 5, 2024
1 parent 42971b2 commit 77ec8ee
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 77ec8ee

Please sign in to comment.