Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions packages/main/scripts/generateI18n.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,14 @@ spawnSync('npx', ['prettier', '--write', path.resolve(SRC_I18N_PROPERTIES, 'i18n
stdio: [0, 1, 2],
});

// generate Assets.js and Assets-static.js
// generate Assets.js
const jsonImports = await readdir(TARGET_I18N_JSON_IMPORTS);

const assets = [`import '@ui5/webcomponents/dist/Assets.js';`, `import '@ui5/webcomponents-fiori/dist/Assets.js';`];
const assetsStatic = [
`import '@ui5/webcomponents/dist/Assets-static.js';`,
`import '@ui5/webcomponents-fiori/dist/Assets-static.js';`,
];

for (const file of jsonImports) {
if (file.includes('-static')) {
assetsStatic.push(`import './json-imports/${file}';`);
if (file.includes('-fetch')) {
//todo: add to Assets-fetch.js
} else {
assets.push(`import './json-imports/${file}';`);
}
Expand All @@ -75,7 +71,3 @@ await writeFile(
path.resolve(DIST_DIR, 'Assets.js'),
await prettier.format(assets.join('\n'), { ...prettierConfig, parser: 'babel' }),
);
await writeFile(
path.resolve(DIST_DIR, 'Assets-static.js'),
await prettier.format(assetsStatic.join('\n'), { ...prettierConfig, parser: 'babel' }),
);
Loading