@@ -30,9 +30,10 @@ class ThemeBuilder {
3030 * @param {module:@ui5/fs.Resource[] } resources Library files
3131 * @param {Object } [options] Build options
3232 * @param {boolean } [options.compress=false] Compress build output (CSS / JSON)
33+ * @param {boolean } [options.compressJSON=false] Compress build output (JSON)
3334 * @returns {Promise<module:@ui5/fs.Resource[]> } Resolving with array of created files
3435 */
35- build ( resources , { compress = false } = { } ) {
36+ build ( resources , { compress = false , compressJSON = false } = { } ) {
3637 const files = [ ] ;
3738
3839 const compile = ( resource ) => {
@@ -67,7 +68,7 @@ class ThemeBuilder {
6768
6869 const libParams = new Resource ( {
6970 path : themeDir + "/library-parameters.json" ,
70- string : JSON . stringify ( result . variables , null , compress ? null : "\t" )
71+ string : JSON . stringify ( result . variables , null , compress || compressJSON ? null : "\t" )
7172 } ) ;
7273
7374 files . push ( libCss , libCssRtl , libParams ) ;
@@ -99,13 +100,15 @@ class ThemeBuilder {
99100 * @param {module:@ui5/fs.Resource[] } parameters.resources List of <code>library.source.less</code> resources to be processed
100101 * @param {fs|module:@ui5/fs.fsInterface } parameters.fs Node fs or custom [fs interface]{@link module:resources/module:@ui5/fs.fsInterface}
101102 * @param {Object } [parameters.options] Options
102- * @param {Object } [parameters.options.compress=false] Compress build output (CSS / JSON)
103+ * @param {boolean } [parameters.options.compress=false] Compress build output (CSS / JSON)
104+ * @param {boolean } [parameters.options.compressJSON=false] Compress build output (JSON)
103105 * @returns {Promise<module:@ui5/fs.Resource[]> } Promise resolving with theme resources
104106 */
105107module . exports = ( { resources, fs, options} ) => {
106108 const themeBuilder = new ThemeBuilder ( { fs} ) ;
107109 const compress = options && options . compress ;
108- return themeBuilder . build ( resources , { compress} ) . then ( ( files ) => {
110+ const compressJSON = options && options . compressJSON ;
111+ return themeBuilder . build ( resources , { compress, compressJSON} ) . then ( ( files ) => {
109112 themeBuilder . clearCache ( ) ;
110113 return files ;
111114 } ) ;
0 commit comments