Skip to content

Commit c15f619

Browse files
authored
Fix i18next and backend loading by replacing node_modules references with CDN links (#4765)
* Fix i18next loading by switching to CDN links in loader.js * fix(i18n): add local fallback for i18next + backend and configure CDN fallback in loader.js
1 parent 6420a1a commit c15f619

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

js/loader.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,22 @@ requirejs.config({
2828
samples: "../sounds/samples",
2929
planet: "../js/planet",
3030
tonejsMidi: "../node_modules/@tonejs/midi/dist/Midi",
31-
i18next: "../node_modules/i18next/dist/umd/i18next.min",
32-
i18nextHttpBackend: "../node_modules/i18next-http-backend/i18nextHttpBackend.min"
31+
i18next: [
32+
"../lib/i18next.min",
33+
"https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/i18next.min"
34+
],
35+
i18nextHttpBackend: [
36+
"../lib/i18nextHttpBackend.min",
37+
"https://cdn.jsdelivr.net/npm/[email protected]/i18nextHttpBackend.min"
38+
]
3339
},
3440
packages: []
3541
});
3642

3743
requirejs(["i18next", "i18nextHttpBackend"], function(i18next, i18nextHttpBackend) {
3844

3945
function updateContent() {
46+
console.log("asdasdasd");
4047
console.log("updateContent() called"); // Debugging line
4148
const elements = document.querySelectorAll("[data-i18n]");
4249

lib/i18next.min.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/i18nextHttpBackend.min.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)