This repository has been archived by the owner on Feb 13, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathGruntfile.js
114 lines (97 loc) · 2.29 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
'use strict';
module.exports = function (grunt) {
// time how long grunt tasks take
require('time-grunt')(grunt);
var path = require('path');
var config = grunt.util._.extend(
require('./tasks/config'),
require('load-grunt-config')(grunt, {
configPath: path.join(process.cwd(), 'tasks/options'),
init: false
})
);
grunt.initConfig(config);
grunt.log.writeln('Environment: ' + config.environment());
grunt.loadTasks('tasks');
grunt.registerTask('serve', function (target) {
if (target === 'dist') {
// use built files in dist instead of raw files
return grunt.task.run(['build', 'connect:dist:keepalive']);
}
// run task list
grunt.task.run([
'clean:server',
'wiredep',
'concurrent:server',
'injector:less_components',
'less',
'autoprefixer',
'injector:local_dependencies',
'karma:ci',
'jshint:all',
'connect:livereload',
'watch:livereload'
]);
});
grunt.registerTask('serve-no-test', function (target) {
if (target === 'dist') {
// use built files in dist instead of raw files
return grunt.task.run(['build', 'connect:dist:keepalive']);
}
// run task list
grunt.task.run([
'clean:server',
'wiredep',
'concurrent:server',
'injector:less_components',
'less',
'autoprefixer',
'injector:local_dependencies',
'connect:livereload',
'watch:livereloadNoTest'
]);
});
grunt.registerTask('lint', [
'jshint:all'
]);
grunt.registerTask('test', [
'travis',
'protractor'
]);
grunt.registerTask('travis', [
'clean:server',
'concurrent:test',
'autoprefixer',
'connect:test',
'karma:ci'
]);
grunt.registerTask('build', [
'clean:dist',
'shell:bower_install',
'shell:bower_update',
'wiredep',
'ngtemplates',
'injector:less_components',
'less',
'injector:local_dependencies',
'useminPrepare',
'concurrent:dist',
'autoprefixer',
'concat',
'ngmin',
'copy:dist',
'copy:jcropGif',
'copy:bootstrapFonts',
'copy:fontawesome',
'copy:fontawesomeCSS',
'copy:zeroclipboard',
'cdnify',
'cssmin',
'uglify'
]);
grunt.registerTask('default', [
'newer:jshint',
'test',
'build'
]);
};