@@ -11,10 +11,10 @@ const generate = async () => {
11
11
const outputFileDynamicImportJSONAttr = path . normalize ( `${ process . argv [ 3 ] } /Themes-node.${ ext } ` ) ;
12
12
const outputFileFetchMetaResolve = path . normalize ( `${ process . argv [ 3 ] } /Themes-fetch.${ ext } ` ) ;
13
13
14
- // All supported optional themes
14
+ // All supported optional themes
15
15
const allThemes = assets . themes . all ;
16
16
17
- // All themes present in the file system
17
+ // All themes present in the file system
18
18
const dirs = await fs . readdir ( inputFolder ) ;
19
19
const themesOnFileSystem = dirs . map ( dir => {
20
20
const matches = dir . match ( / s a p _ .* $ / ) ;
@@ -28,7 +28,7 @@ const generate = async () => {
28
28
const dynamicImportJSONAttrLines = themesOnFileSystem . map ( theme => `\t\tcase "${ theme } ": return (await import(/* webpackChunkName: "${ packageName . replace ( "@" , "" ) . replace ( "/" , "-" ) } -${ theme . replace ( "_" , "-" ) } -parameters-bundle" */"../assets/themes/${ theme } /parameters-bundle.css.json", {with: { type: 'json'}})).default;` ) . join ( "\n" ) ;
29
29
const fetchMetaResolveLines = themesOnFileSystem . map ( theme => `\t\tcase "${ theme } ": return (await fetch(new URL("../assets/themes/${ theme } /parameters-bundle.css.json", import.meta.url))).json();` ) . join ( "\n" ) ;
30
30
31
- // dynamic imports file content
31
+ // dynamic imports file content
32
32
const contentDynamic = function ( lines ) {
33
33
return `// @ts-nocheck
34
34
import { registerThemePropertiesLoader } from "@ui5/webcomponents-base/dist/asset-registries/Themes.js";
@@ -49,7 +49,7 @@ const loadAndCheck = async (themeName) => {
49
49
};
50
50
51
51
${ availableThemesArray }
52
- .forEach(themeName => registerThemePropertiesLoader(" ${ packageName } " , themeName, loadAndCheck));
52
+ .forEach(themeName => registerThemePropertiesLoader(${ packageName . split ( "" ) . map ( c => `" ${ c } "` ) . join ( " + " ) } , themeName, loadAndCheck));
53
53
` ;
54
54
}
55
55
0 commit comments