From 7ff4821814e12a3f619ddb674f09a19896285244 Mon Sep 17 00:00:00 2001 From: Alexey Golubev Date: Mon, 9 Apr 2018 15:02:13 +0300 Subject: [PATCH] Add json minify task --- build/Gruntfile.js | 19 +++++++++++++++++-- build/documenteditor.json | 6 ++++++ build/package.json | 1 + build/presentationeditor.json | 6 ++++++ build/spreadsheeteditor.json | 6 ++++++ 5 files changed, 36 insertions(+), 2 deletions(-) diff --git a/build/Gruntfile.js b/build/Gruntfile.js index b2d7c1496..b1ab33aa0 100644 --- a/build/Gruntfile.js +++ b/build/Gruntfile.js @@ -21,6 +21,7 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-contrib-imagemin'); grunt.loadNpmTasks('grunt-contrib-cssmin'); grunt.loadNpmTasks('grunt-contrib-htmlmin'); + grunt.loadNpmTasks('grunt-json-minify'); grunt.loadNpmTasks('grunt-text-replace'); grunt.loadNpmTasks('grunt-mocha'); grunt.loadNpmTasks('grunt-inline'); @@ -207,6 +208,12 @@ module.exports = function(grunt) { } }, + 'json-minify': { + build: { + files: packageFile['main']['jsonmin']['files'] + } + }, + copy: { localization: { files: packageFile['main']['copy']['localization'] @@ -308,6 +315,12 @@ module.exports = function(grunt) { } }, + 'json-minify': { + build: { + files: packageFile['mobile']['jsonmin']['files'] + } + }, + copy: { 'template-backup': { files: packageFile['mobile']['copy']['template-backup'] @@ -423,12 +436,14 @@ module.exports = function(grunt) { grunt.registerTask('deploy-requirejs', ['requirejs-init', 'clean', 'uglify']); grunt.registerTask('deploy-app-main', ['main-app-init', 'clean:prebuild', 'imagemin', 'less', 'requirejs', 'concat', - 'copy', 'svgmin', 'inline', 'replace:writeVersion', 'clean:postbuild']); + 'copy', 'svgmin', 'inline', 'json-minify', + 'replace:writeVersion', 'clean:postbuild']); grunt.registerTask('deploy-app-mobile', ['mobile-app-init', 'clean:deploy', 'cssmin', 'copy:template-backup', 'htmlmin', 'requirejs', 'concat', 'copy:template-restore', 'clean:template-backup', 'copy:localization', 'copy:index-page', - 'copy:images-app', 'replace:writeVersion', 'replace:fixResourceUrl']); + 'copy:images-app', 'json-minify', + 'replace:writeVersion', 'replace:fixResourceUrl']); grunt.registerTask('deploy-app-embed', ['embed-app-init', 'clean:prebuild', 'uglify', 'less', 'copy', 'clean:postbuild']); diff --git a/build/documenteditor.json b/build/documenteditor.json index 9d3e536f1..74249d61d 100644 --- a/build/documenteditor.json +++ b/build/documenteditor.json @@ -135,6 +135,9 @@ } ] }, + "jsonmin": { + "files": "../deploy/web-apps/apps/documenteditor/main/**/*.json" + }, "copy": { "localization": [ { @@ -300,6 +303,9 @@ } ] }, + "jsonmin": { + "files": "../deploy/web-apps/apps/documenteditor/mobile/**/*.json" + }, "copy": { "template-backup": [ { diff --git a/build/package.json b/build/package.json index 99f14b1d0..a9b738196 100644 --- a/build/package.json +++ b/build/package.json @@ -21,6 +21,7 @@ "grunt-contrib-imagemin": "^1.0.0", "grunt-contrib-cssmin": "^1.0.0", "grunt-contrib-htmlmin": "^2.0.0", + "grunt-json-minify": "^1.1.0", "vinyl-fs": "2.2.1", "less-plugin-clean-css": "1.5.0", "grunt-svgmin": "4.0.0", diff --git a/build/presentationeditor.json b/build/presentationeditor.json index ce9cf3ab6..d6b3bf23a 100644 --- a/build/presentationeditor.json +++ b/build/presentationeditor.json @@ -135,6 +135,9 @@ } ] }, + "jsonmin": { + "files": "../deploy/web-apps/apps/presentationeditor/main/**/*.json" + }, "copy": { "localization": [ { @@ -309,6 +312,9 @@ } ] }, + "jsonmin": { + "files": "../deploy/web-apps/apps/presentationeditor/mobile/**/*.json" + }, "copy": { "template-backup": [ { diff --git a/build/spreadsheeteditor.json b/build/spreadsheeteditor.json index 63c60b2b2..0bfacbd07 100644 --- a/build/spreadsheeteditor.json +++ b/build/spreadsheeteditor.json @@ -143,6 +143,9 @@ } ] }, + "jsonmin": { + "files": "../deploy/web-apps/apps/spreadsheeteditor/main/**/*.json" + }, "copy": { "localization": [ { @@ -311,6 +314,9 @@ } ] }, + "jsonmin": { + "files": "../deploy/web-apps/apps/spreadsheeteditor/mobile/**/*.json" + }, "copy": { "template-backup": [ {