[ESM] Convert the external/importL10n-folder to use standard modules

This commit is contained in:
Jonas Jenwald 2023-07-08 09:29:51 +02:00
parent 5696c3aa3a
commit a650fcd634
3 changed files with 10 additions and 16 deletions

View file

@ -1880,7 +1880,7 @@ gulp.task("lint", function (done) {
const esLintOptions = [
"node_modules/eslint/bin/eslint",
"--ext",
".js,.jsm,.json",
".js,.jsm,.mjs,.json",
".",
"--report-unused-disable-directives",
];
@ -2004,8 +2004,8 @@ gulp.task("clean", function (done) {
rimraf(BUILD_DIR, done);
});
gulp.task("importl10n", function (done) {
const locales = require("./external/importL10n/locales.js");
gulp.task("importl10n", async function () {
const { downloadL10n } = await import("./external/importL10n/locales.mjs");
console.log();
console.log("### Importing translations from mozilla-central");
@ -2013,7 +2013,7 @@ gulp.task("importl10n", function (done) {
if (!fs.existsSync(L10N_DIR)) {
fs.mkdirSync(L10N_DIR);
}
locales.downloadL10n(L10N_DIR, done);
await downloadL10n(L10N_DIR);
});
function ghPagesPrepare() {