@@ -30,9 +30,10 @@ class ThemeBuilder {
30
30
* @param {module:@ui5/fs.Resource[] } resources Library files
31
31
* @param {Object } [options] Build options
32
32
* @param {boolean } [options.compress=false] Compress build output (CSS / JSON)
33
+ * @param {boolean } [options.compressJSON=false] Compress build output (JSON)
33
34
* @returns {Promise<module:@ui5/fs.Resource[]> } Resolving with array of created files
34
35
*/
35
- build ( resources , { compress = false } = { } ) {
36
+ build ( resources , { compress = false , compressJSON = false } = { } ) {
36
37
const files = [ ] ;
37
38
38
39
const compile = ( resource ) => {
@@ -67,7 +68,7 @@ class ThemeBuilder {
67
68
68
69
const libParams = new Resource ( {
69
70
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" )
71
72
} ) ;
72
73
73
74
files . push ( libCss , libCssRtl , libParams ) ;
@@ -99,13 +100,15 @@ class ThemeBuilder {
99
100
* @param {module:@ui5/fs.Resource[] } parameters.resources List of <code>library.source.less</code> resources to be processed
100
101
* @param {fs|module:@ui5/fs.fsInterface } parameters.fs Node fs or custom [fs interface]{@link module:resources/module:@ui5/fs.fsInterface}
101
102
* @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)
103
105
* @returns {Promise<module:@ui5/fs.Resource[]> } Promise resolving with theme resources
104
106
*/
105
107
module . exports = ( { resources, fs, options} ) => {
106
108
const themeBuilder = new ThemeBuilder ( { fs} ) ;
107
109
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 ) => {
109
112
themeBuilder . clearCache ( ) ;
110
113
return files ;
111
114
} ) ;
0 commit comments