Skip to content

Commit bd8de6c

Browse files
committed
(build) allow third-party packages to override default languages
1 parent 62f8a60 commit bd8de6c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tools/lib/dependencies.js

+3
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ const isGroup = (id) => id[0] === ":";
4141
*
4242
* This also resolves any requires and dependency ordering issues.
4343
* The returned list can be registered sequentially and should "just work".
44+
* If multiple languages have the same name, the last one wins.
45+
* This gives priority to third-party packages so they can override built-in languages.
4446
*
4547
* @param {array<Lanuage>} allLanguages - full list of languages
4648
* @param {array<name|group_name>} includes - which languages or groups to include
@@ -50,6 +52,7 @@ const isGroup = (id) => id[0] === ":";
5052
const filter = (allLanguages, includes) => {
5153
if (!includes || includes.length === 0) { return reorderDependencies(allLanguages); }
5254

55+
allLanguages.reverse();
5356
let languages = [];
5457
for (const item of includes) {
5558
if (isGroup(item)) {

0 commit comments

Comments
 (0)