From 933e21003713c89be80d8d05dcf4bb36950522a3 Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Tue, 28 May 2024 17:01:50 +0000 Subject: [PATCH] fix: lang file imports (#8179) --- scripts/gulpfiles/build_tasks.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/gulpfiles/build_tasks.js b/scripts/gulpfiles/build_tasks.js index d7b118f32..27a02cf30 100644 --- a/scripts/gulpfiles/build_tasks.js +++ b/scripts/gulpfiles/build_tasks.js @@ -677,12 +677,13 @@ async function buildLangfileShims() { // its named exports. const cjsPath = `./${lang}.js`; const wrapperPath = path.join(RELEASE_DIR, 'msg', `${lang}.mjs`); + const safeLang = lang.replace(/-/g, '_'); await fsPromises.writeFile(wrapperPath, - `import ${lang} from '${cjsPath}'; + `import ${safeLang} from '${cjsPath}'; export const { ${exportedNames.map((name) => ` ${name},`).join('\n')} -} = ${lang}; +} = ${safeLang}; `); })); }