forked from unrealutkarsh/appsforhere
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
55 lines (55 loc) · 1.32 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
'use strict';
var fs = require('fs');
module.exports = function(grunt) {
// Load the project's grunt tasks from a directory
require('grunt-config-dir')(grunt, {
configDir: require('path').resolve('tasks')
});
grunt.registerTask('native-deps', function() {
var packageInfo = JSON.parse(fs.readFileSync('.heroku/package.json').toString());
for (var pk in packageInfo.herokuDependencies) {
packageInfo.dependencies[pk] = packageInfo.herokuDependencies[pk];
}
fs.writeFileSync('.heroku/package.json', JSON.stringify(packageInfo));
delete packageInfo.herokuDependencies;
});
// Register group tasks
grunt.registerTask('build', [
'jshint',
'less',
'uglify:build',
'browserify:build',
'i18n',
'copyto:build'
]);
grunt.registerTask('debug', [
'jshint',
'less',
'uglify:debug',
'browserify:debug',
'i18n',
'copyto:build'
]);
grunt.registerTask('test', [
'jshint',
'less',
'uglify:build',
'browserify:build',
'i18n',
'copyto:build',
'mochacli',
'loopmocha:local'
]);
grunt.registerTask('package', [
'clean:package',
'build',
'copyto:package'
]);
grunt.registerTask('heroku', [
'clean:heroku',
'build',
'copyto:heroku',
'native-deps'
]);
grunt.registerTask('auto', ['loopmocha:local']);
};