@@ -55,16 +55,24 @@ spawnSync('npx', ['prettier', '--write', path.resolve(SRC_I18N_PROPERTIES, 'i18n
5555 stdio : [ 0 , 1 , 2 ] ,
5656} ) ;
5757
58- // generate Assets.js
58+ // generate Assets.js and Assets-fetch.js
5959const jsonImports = await readdir ( TARGET_I18N_JSON_IMPORTS ) ;
6060
6161const assets = [ `import '@ui5/webcomponents/dist/Assets.js';` , `import '@ui5/webcomponents-fiori/dist/Assets.js';` ] ;
62+ const assetsFetch = [
63+ `import '@ui5/webcomponents/dist/Assets-fetch.js';` ,
64+ `import '@ui5/webcomponents-fiori/dist/Assets-fetch.js';` ,
65+ ] ;
66+ const assetsNode = [
67+ `import '@ui5/webcomponents/dist/Assets-node.js';` ,
68+ `import '@ui5/webcomponents-fiori/dist/Assets-node.js';` ,
69+ ] ;
6270
6371for ( const file of jsonImports ) {
6472 if ( file . includes ( '-fetch' ) ) {
65- //todo: add to Assets-fetch.js
73+ assetsFetch . push ( `import './json-imports/ ${ file } ';` ) ;
6674 } else if ( file . includes ( '-node' ) ) {
67- //todo: add to Assets-node.js
75+ assetsNode . push ( `import './json-imports/ ${ file } ';` ) ;
6876 } else {
6977 assets . push ( `import './json-imports/${ file } ';` ) ;
7078 }
@@ -74,3 +82,13 @@ await writeFile(
7482 path . resolve ( DIST_DIR , 'Assets.js' ) ,
7583 await prettier . format ( assets . join ( '\n' ) , { ...prettierConfig , parser : 'babel' } ) ,
7684) ;
85+
86+ await writeFile (
87+ path . resolve ( DIST_DIR , 'Assets-fetch.js' ) ,
88+ await prettier . format ( assetsFetch . join ( '\n' ) , { ...prettierConfig , parser : 'babel' } ) ,
89+ ) ;
90+
91+ await writeFile (
92+ path . resolve ( DIST_DIR , 'Assets-node.js' ) ,
93+ await prettier . format ( assetsNode . join ( '\n' ) , { ...prettierConfig , parser : 'babel' } ) ,
94+ ) ;
0 commit comments