Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.2][bug] Codemirror duplicated assets entries #44674

Merged
merged 16 commits into from
Jan 9, 2025
Merged
6 changes: 3 additions & 3 deletions build/build-modules-js/init/common/resolve-package.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports.resolvePackageFile = (relativePath) => {
* @returns {[]}
*/
module.exports.getPackagesUnderScope = (scope) => {
const cmModules = [];
const cmModules = new Set();

// Get the scope roots
const roots = [];
Expand All @@ -41,9 +41,9 @@ module.exports.getPackagesUnderScope = (scope) => {
// List of modules
roots.forEach((rootPath) => {
readdirSync(rootPath).forEach((subModule) => {
cmModules.push(`${scope}/${subModule}`);
cmModules.add(`${scope}/${subModule}`);
});
});

return cmModules;
return [...cmModules];
};