-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
84 lines (78 loc) · 1.77 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
module.exports = gruntConfig;
function gruntConfig(grunt) {
var
pkg = grunt.file.readJSON('package.json'),
tasks = require('./tasks/grunt'),
gruntInitConfig;
gruntInitConfig = {
// Set these to the appropriate directories
jsPath: 'assets/js',
componentsPath: 'assets/components',
cssPath: 'assets/css',
htmlPath: 'assets/templates',
imagePath: 'assets/img',
fontPath: 'assets/fonts',
pubJsPath: 'public/js',
pubCssPath: 'public/css',
pubImagePath: 'public/img',
pubFontPath: 'public/fonts'
};
for (var task in tasks) {
gruntInitConfig[task] = tasks[task];
}
grunt.initConfig(gruntInitConfig);
for (var dep in pkg.devDependencies) {
if (dep !== 'grunt' && !dep.indexOf('grunt')) {
grunt.loadNpmTasks(dep);
}
}
grunt.registerTask('build:dev', [
'copy',
'imagemin',
'ngtemplates',
'concat',
'sass:dev'
]);
grunt.registerTask('build:dist', [
'build:dev',
'sass:dist',
'uglify'
]);
grunt.registerTask('build:watch', [
'build:dist',
'watch'
]);
grunt.registerTask('protractor:dev', [
'env:dev',
'bgShell:protractor'
]);
grunt.registerTask('protractor:dist', [
'env:test',
'bgShell:protractor'
]);
grunt.registerTask('test:dev', [
'env:test',
'jshint',
'karma:dev',
'protractor:dev',
'mocha_istanbul:test'
]);
grunt.registerTask('test:dist', [
'env:test',
'jshint',
// Run the dev tests for the coverage reporting
'karma:dev',
// Re-run the dist tests to ensure minified version passes
'karma:dist',
'protractor:dist',
'mocha_istanbul:test'
]);
grunt.registerTask('server', [
'env:dev',
'bgShell:server'
]);
grunt.registerTask('default', [
'build:dist',
'server'
]);
}