install grunt-newer to run uglify only for targets with changed files

This commit is contained in:
Ralf Becker 2016-03-02 20:00:41 +00:00
parent 8d8cb48da3
commit 3377ef0483
2 changed files with 9 additions and 4 deletions

View File

@ -14,12 +14,13 @@
* sudo npm install -g grunt-cli
* npm install grunt --save-dev
* npm install grunt-contrib-uglify --save-dev
* npm install grunt-newer --save-dev
*
* Building happens by running in your EGroupware directory:
*
* grunt
* grunt # runs uglify for all targets with changed files
* or
* grunt uglify:<target> # targets: api, et2, pixelegg, mobile, mail, calendar, ...
* grunt [newer:]uglify:<target> # targets: api, et2, pixelegg, mobile, mail, calendar, ...
*
* app.js files can be added like mail target or, if you want automatic dependencies,
* you need to add them in egw_framework::$bundle2minurl and egw_framework::get_bundles().
@ -255,6 +256,9 @@ module.exports = function (grunt) {
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');
// Load the plugin that runs tasks only on modified files
grunt.loadNpmTasks('grunt-newer');
// Default task(s).
grunt.registerTask('default', ['uglify']);
grunt.registerTask('default', ['newer:uglify']);
};

View File

@ -7,6 +7,7 @@
"repository": {},
"devDependencies": {
"grunt": "^0.4.5",
"grunt-contrib-uglify": "^0.11.1"
"grunt-contrib-uglify": "^0.11.1",
"grunt-newer": "^1.1.2"
}
}