Skip to content
This repository has been archived by the owner on Mar 30, 2024. It is now read-only.

Commit

Permalink
Added pre and post-build hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Karl committed Aug 3, 2015
1 parent 1b78f02 commit 0710fe4
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
13 changes: 11 additions & 2 deletions tasks/aliases.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,39 @@ 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',
'replace:main',
'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'
]
);

Expand Down

0 comments on commit 0710fe4

Please sign in to comment.