@@ -11,10 +11,10 @@ const generate = async () => {
1111 const outputFileDynamicImportJSONAttr = path . normalize ( `${ process . argv [ 3 ] } /Themes-node.${ ext } ` ) ;
1212 const outputFileFetchMetaResolve = path . normalize ( `${ process . argv [ 3 ] } /Themes-fetch.${ ext } ` ) ;
1313
14- // All supported optional themes
14+ // All supported optional themes
1515 const allThemes = assets . themes . all ;
1616
17- // All themes present in the file system
17+ // All themes present in the file system
1818 const dirs = await fs . readdir ( inputFolder ) ;
1919 const themesOnFileSystem = dirs . map ( dir => {
2020 const matches = dir . match ( / s a p _ .* $ / ) ;
@@ -28,7 +28,7 @@ const generate = async () => {
2828 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" ) ;
2929 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" ) ;
3030
31- // dynamic imports file content
31+ // dynamic imports file content
3232 const contentDynamic = function ( lines ) {
3333 return `// @ts-nocheck
3434import { registerThemePropertiesLoader } from "@ui5/webcomponents-base/dist/asset-registries/Themes.js";
@@ -49,7 +49,7 @@ const loadAndCheck = async (themeName) => {
4949};
5050
5151${ availableThemesArray }
52- .forEach(themeName => registerThemePropertiesLoader(" ${ packageName } " , themeName, loadAndCheck));
52+ .forEach(themeName => registerThemePropertiesLoader(${ packageName . split ( "" ) . map ( c => `" ${ c } "` ) . join ( " + " ) } , themeName, loadAndCheck));
5353` ;
5454 }
5555
0 commit comments