Skip to content

Commit 8fdf667

Browse files
committed
feat(Assets): add Assets-fetch.js
1 parent 3e372ef commit 8fdf667

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

packages/main/scripts/generateI18n.mjs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,19 @@ spawnSync('npx', ['prettier', '--write', path.resolve(SRC_I18N_PROPERTIES, 'i18n
5454
stdio: [0, 1, 2],
5555
});
5656

57-
// generate Assets.js
57+
// generate Assets.js and Assets-fetch.js
5858
const jsonImports = await readdir(TARGET_I18N_JSON_IMPORTS);
5959

6060
const assets = [`import '@ui5/webcomponents/dist/Assets.js';`, `import '@ui5/webcomponents-fiori/dist/Assets.js';`];
61+
const assetsFetch = [
62+
`import '@ui5/webcomponents/dist/Assets-fetch.js';`,
63+
//todo: currently the fiori package doesn't include `Assets-fetch` - clarify if this is intended
64+
// `import '@ui5/webcomponents-fiori/dist/Assets-fetch.js';`,
65+
];
6166

6267
for (const file of jsonImports) {
6368
if (file.includes('-fetch')) {
64-
//todo: add to Assets-fetch.js
69+
assetsFetch.push(`import './json-imports/${file}';`);
6570
} else {
6671
assets.push(`import './json-imports/${file}';`);
6772
}
@@ -71,3 +76,8 @@ await writeFile(
7176
path.resolve(DIST_DIR, 'Assets.js'),
7277
await prettier.format(assets.join('\n'), { ...prettierConfig, parser: 'babel' }),
7378
);
79+
80+
await writeFile(
81+
path.resolve(DIST_DIR, 'Assets-fetch.js'),
82+
await prettier.format(assetsFetch.join('\n'), { ...prettierConfig, parser: 'babel' }),
83+
);

0 commit comments

Comments
 (0)