mirror of
https://github.com/google/blockly.git
synced 2026-01-05 08:00:09 +01:00
fix: lang file imports (#8179)
This commit is contained in:
@@ -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};
|
||||
`);
|
||||
}));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user