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 * sudo npm install -g grunt-cli
* npm install grunt --save-dev * npm install grunt --save-dev
* npm install grunt-contrib-uglify --save-dev * npm install grunt-contrib-uglify --save-dev
* npm install grunt-newer --save-dev
* *
* Building happens by running in your EGroupware directory: * Building happens by running in your EGroupware directory:
* *
* grunt * grunt # runs uglify for all targets with changed files
* or * 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, * 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(). * 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. // Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-uglify');
// Load the plugin that runs tasks only on modified files
grunt.loadNpmTasks('grunt-newer');
// Default task(s). // Default task(s).
grunt.registerTask('default', ['uglify']); grunt.registerTask('default', ['newer:uglify']);
}; };

View File

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