@@ -55,16 +55,24 @@ spawnSync('npx', ['prettier', '--write', path.resolve(SRC_I18N_PROPERTIES, 'i18n
55
55
stdio : [ 0 , 1 , 2 ] ,
56
56
} ) ;
57
57
58
- // generate Assets.js
58
+ // generate Assets.js and Assets-fetch.js
59
59
const jsonImports = await readdir ( TARGET_I18N_JSON_IMPORTS ) ;
60
60
61
61
const 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
+ ] ;
62
70
63
71
for ( const file of jsonImports ) {
64
72
if ( file . includes ( '-fetch' ) ) {
65
- //todo: add to Assets-fetch.js
73
+ assetsFetch . push ( `import './json-imports/ ${ file } ';` ) ;
66
74
} else if ( file . includes ( '-node' ) ) {
67
- //todo: add to Assets-node.js
75
+ assetsNode . push ( `import './json-imports/ ${ file } ';` ) ;
68
76
} else {
69
77
assets . push ( `import './json-imports/${ file } ';` ) ;
70
78
}
@@ -74,3 +82,13 @@ await writeFile(
74
82
path . resolve ( DIST_DIR , 'Assets.js' ) ,
75
83
await prettier . format ( assets . join ( '\n' ) , { ...prettierConfig , parser : 'babel' } ) ,
76
84
) ;
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