diff --git a/build/Gruntfile.js b/build/Gruntfile.js index cdffd45a3..f3e16b586 100644 --- a/build/Gruntfile.js +++ b/build/Gruntfile.js @@ -60,6 +60,14 @@ module.exports = function(grunt) { to: process.env['PLUGIN_LINK_MACROS'] || 'https://api.onlyoffice.com/plugin/macros' }]; + let path = require('path'); + let addons = grunt.option('addon') || []; + if (!Array.isArray(addons)) + addons = [addons]; + + addons.forEach((element,index,self) => self[index] = '../../web-apps-' + element + '/build'); + addons = addons.filter(element => grunt.file.isDir(element)); + grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-contrib-uglify'); @@ -134,6 +142,14 @@ module.exports = function(grunt) { if (packageFile) { grunt.log.ok(appName + ' config loaded successfully'.green); + addons.forEach(element => { + let _path = path.join(element,configFile); + if (grunt.file.exists(_path)) { + _merge(packageFile, require(_path)); + grunt.log.ok('addon '.green + element + ' is merged successfully'.green); + } + }); + if ( !!_extConfig && _extConfig.name == packageFile.name ) { _merge(packageFile, _extConfig); }