[build] copy common images to common directory

This commit is contained in:
Maxim Kadushkin 2021-09-06 19:03:36 +03:00
parent b1bbf0877e
commit 056b0e9a49
2 changed files with 51 additions and 2 deletions

View file

@ -245,7 +245,33 @@ module.exports = function(grunt) {
}
}
});
doRegisterTask('apps-common');
doRegisterTask('apps-common', (defaultConfig, packageFile) => {
return {
imagemin: {
options: {
optimizationLevel: 3
},
dynamic: {
files: packageFile['apps-common']['imagemin']['images-common']
}
},
svgmin: {
options: {
plugins: [{
cleanupIDs: false
},
{
convertPathData: {
floatPrecision: 4
}
}]
},
dist: {
files: packageFile['apps-common'].svgicons.common
}
},
}
});
doRegisterTask('sockjs');
doRegisterTask('xregexp');
doRegisterTask('megapixel');
@ -614,7 +640,7 @@ module.exports = function(grunt) {
var copyTask = grunt.option('desktop')? "copy": "copy:script";
grunt.registerTask('deploy-api', ['api-init', 'clean', copyTask, 'replace:writeVersion']);
grunt.registerTask('deploy-apps-common', ['apps-common-init', 'clean', 'copy']);
grunt.registerTask('deploy-apps-common', ['apps-common-init', 'clean', 'copy', 'imagemin', 'svgmin']);
grunt.registerTask('deploy-sdk', ['sdk-init', 'clean', copyTask]);
grunt.registerTask('deploy-sockjs', ['sockjs-init', 'clean', 'copy']);

View file

@ -90,6 +90,29 @@
"src": "*.json",
"dest": "../deploy/web-apps/apps/common/main/resources/alphabetletters"
}
},
"imagemin": {
"images-common": [
{
"expand": true,
"cwd": "../apps/common/main/resources/img/",
"src": [
"**/*.{png,jpg,gif}",
"!toolbar/*x/**/*"
],
"dest": "../deploy/web-apps/apps/common/main/resources/img/"
}
]
},
"svgicons": {
"common": [
{
"expand": true,
"cwd": "../apps/common/main/resources/img",
"src": "**/*_s.svg",
"dest": "../deploy/web-apps/apps/common/main/resources/img"
}
]
}
},
"bootstrap": {