Skip to content

Commit

Permalink
(build) allow third-party packages to override default languages
Browse files Browse the repository at this point in the history
  • Loading branch information
Lysxia committed Jan 24, 2025
1 parent 62f8a60 commit bd8de6c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tools/lib/dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ const isGroup = (id) => id[0] === ":";
*
* This also resolves any requires and dependency ordering issues.
* The returned list can be registered sequentially and should "just work".
* If multiple languages have the same name, the last one wins.
* This gives priority to third-party packages so they can override built-in languages.
*
* @param {array<Lanuage>} allLanguages - full list of languages
* @param {array<name|group_name>} includes - which languages or groups to include
Expand All @@ -50,6 +52,7 @@ const isGroup = (id) => id[0] === ":";
const filter = (allLanguages, includes) => {
if (!includes || includes.length === 0) { return reorderDependencies(allLanguages); }

allLanguages.reverse();
let languages = [];
for (const item of includes) {
if (isGroup(item)) {
Expand Down

0 comments on commit bd8de6c

Please sign in to comment.