diff --git a/README.md b/README.md index 3719b29..cbd2577 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,17 @@ Task | Description **run** | Preview the deploy index.html file in a web browser by running a NodeJS server **version** | Control the project versioning, and update the version number in **project.json** and **bower.json**. This task requires a single argument, for instance, **version:1.0.0** (uses the [Semantic Version](http://semver.org/) format) or increment the version using **version:major**, **version:minor** or **version:patch**. Change the version _before_ doing a build. +## Task Hooks + +These are the list of grunt tasks which are safe to be overridden using `grunt.registerTask()`. These task aliases are empty and contain no sub-tasks. + +Task | Description +---|--- +**_pre-build** | Before the build starts. +**_pre-build-debug** | Before the debug build starts. +**_post-build** | After the build ends. +**_post-build-debug** | After the debug build ends. + ## Project File The **project.json** file contains the list of all required JavaScript and CSS files in order to build the project. Below describes the different fields of this file. diff --git a/package.json b/package.json index 3a83785..9832482 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "project-grunt", - "version": "0.6.6", + "version": "0.6.7", "description": "Tasks and scaffolding for an HTML project", "main": "./libs/index.js", "author": { diff --git a/tasks/aliases.js b/tasks/aliases.js index dcad4a5..0bcd9de 100644 --- a/tasks/aliases.js +++ b/tasks/aliases.js @@ -12,9 +12,15 @@ module.exports = function(grunt) ['build-debug'] ); + grunt.registerTask('_pre-build', []); + grunt.registerTask('_post-build', []); + grunt.registerTask('_pre-build-debug', []); + grunt.registerTask('_post-build-debug', []); + grunt.registerTask( 'build-debug', 'compile all elements in debug mode', [ + '_pre-build-debug', 'clean:main', 'jshint:main', 'concat:main', @@ -22,20 +28,23 @@ module.exports = function(grunt) 'clean:css', 'less:development', 'moduleTasksDebug', - 'libs-debug' + 'libs-debug', + '_post-build-debug' ] ); grunt.registerTask( 'build', 'compile all elements in release mode', [ + '_pre-build', 'clean:main', 'jshint:main', 'uglify:main', 'clean:css', 'less:release', 'moduleTasks', - 'libs' + 'libs', + '_post-build' ] );