-
Notifications
You must be signed in to change notification settings - Fork 174
/
gruntfile.js
144 lines (138 loc) · 8.82 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
'use strict';
module.exports = function(grunt) {
// Project Configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
jade: {
files: ['app/views/**'],
options: {
livereload: true,
},
},
js: {
files: ['public/js/**', 'app/**/*.js', 'config/**/*.js'],
tasks: ['jshint'],
options: {
livereload: true,
},
},
html: {
files: ['public/views/**'],
options: {
livereload: true,
},
},
css: {
files: ['public/css/**'],
options: {
livereload: true
}
}
},
jshint: {
all:['gruntfile.js', 'public/js/**/*.js', 'test/mocha/**/*.js', 'test/karma/**/*.js', 'app/**/*.js'],
options: {
jshintrc: '.jshintrc',
reporter: require('jshint-stylish')
}
},
copy: {
options: {
punctuation: ''
},
js: {
files: [
{cwd: 'bower_components/angular-bootstrap', src: ['**/*.js'], dest: 'public/lib/angular-bootstrap', expand: true},
{cwd: 'bower_components/angular-cookies', src: ['angular-cookies*'], dest: 'public/lib/angular-cookies', expand: true},
{cwd: 'bower_components/angular-mocks', src: ['**/*.js'], dest: 'public/lib/angular-mocks', expand: true},
{cwd: 'bower_components/angular-resource', src: ['angular-resource*'], dest: 'public/lib/angular-resource', expand: true},
{cwd: 'bower_components/angular-route', src: ['angular-route*'], dest: 'public/lib/angular-route', expand: true},
{cwd: 'bower_components/angular', src: ['angular*'], dest: 'public/lib/angular', expand: true},
{cwd: 'bower_components/angular-ui-utils/demo', src: ['**/*.js'], dest: 'public/lib/angular-ui-utils/demo', expand: true},
{cwd: 'bower_components/angular-ui-utils/test', src: ['**/*.js'], dest: 'public/lib/angular-ui-utils/test', expand: true},
{cwd: 'bower_components/angular-ui-utils/modules', src: ['**/*.js'], dest: 'public/lib/angular-ui-utils/modules', expand: true},
{cwd: 'bower_components/angular-ui-utils/modules/event', src: ['**/*.js'], dest: 'public/lib/angular-ui-utils/modules/event', expand: true},
{cwd: 'bower_components/angular-ui-utils/modules/format', src: ['**/*.js'], dest: 'public/lib/angular-ui-utils/modules/format', expand: true},
{cwd: 'bower_components/angular-ui-utils/modules/highlight', src: ['**/*.js'], dest: 'public/lib/angular-ui-utils/modules/highlight', expand: true},
{cwd: 'bower_components/angular-ui-utils/modules/ie-shiv', src: ['**/*.js'], dest: 'public/lib/angular-ui-utils/modules/ie-shiv', expand: true},
{cwd: 'bower_components/angular-ui-utils/modules/indeterminate', src: ['**/*.js'], dest: 'public/lib/angular-ui-utils/modules/indeterminate', expand: true},
{cwd: 'bower_components/angular-ui-utils/modules/inflector', src: ['**/*.js'], dest: 'public/lib/angular-ui-utils/modules/inflector', expand: true},
{cwd: 'bower_components/angular-ui-utils/modules/jq', src: ['**/*.js'], dest: 'public/lib/angular-ui-utils/modules/jq', expand: true},
{cwd: 'bower_components/angular-ui-utils/modules/keypress', src: ['**/*.js'], dest: 'public/lib/angular-ui-utils/modules/keypress', expand: true},
{cwd: 'bower_components/angular-ui-utils/modules/mask', src: ['**/*.js'], dest: 'public/lib/angular-ui-utils/modules/mask', expand: true},
{cwd: 'bower_components/angular-ui-utils/modules/reset', src: ['**/*.js'], dest: 'public/lib/angular-ui-utils/modules/reset', expand: true},
{cwd: 'bower_components/angular-ui-utils/modules/reset/stylesheets', src: ['**/*.js'], dest: 'public/lib/angular-ui-utils/modules/reset/stylesheets', expand: true},
{cwd: 'bower_components/angular-ui-utils/modules/route', src: ['**/*.js'], dest: 'public/lib/angular-ui-utils/modules/route', expand: true},
{cwd: 'bower_components/angular-ui-utils/modules/scrollfix', src: ['**/*.js'], dest: 'public/lib/angular-ui-utils/modules/scrollfix', expand: true},
{cwd: 'bower_components/angular-ui-utils/modules/showhide', src: ['**/*.js'], dest: 'public/lib/angular-ui-utils/modules/showhide', expand: true},
{cwd: 'bower_components/angular-ui-utils/modules/unique', src: ['**/*.js'], dest: 'public/lib/angular-ui-utils/modules/unique', expand: true},
{cwd: 'bower_components/angular-ui-utils/modules/validate', src: ['**/*.js'], dest: 'public/lib/angular-ui-utils/modules/validate', expand: true},
{cwd: 'bower_components/bootstrap/js', src: ['*.js'], dest: 'public/lib/bootstrap/js', expand: true},
{cwd: 'bower_components/bootstrap/less', src: ['*.less'], dest: 'public/lib/bootstrap/less', expand: true},
{cwd: 'bower_components/bootstrap/docs/assets/css', src: ['*.*'], dest: 'public/lib/bootstrap/docs/assets/css', expand: true},
{cwd: 'bower_components/bootstrap/docs/assets/ico', src: ['*.*'], dest: 'public/lib/bootstrap/docs/assets/ico', expand: true},
{cwd: 'bower_components/bootstrap/docs/assets/img', src: ['*.*'], dest: 'public/lib/bootstrap/docs/assets/img', expand: true},
{cwd: 'bower_components/bootstrap/docs/assets/js', src: ['*.*'], dest: 'public/lib/bootstrap/docs/assets/js', expand: true},
{cwd: 'bower_components/satellizer/dist', src: ['**/*.js'], dest: 'public/lib/satellizer', expand: true},
{cwd: 'bower_components/angular-fblogin/dist', src: ['**/*.js'], dest: 'public/lib/social', expand: true},
{cwd: 'bower_components/jquery', src: ['jquery*'], dest: 'public/lib/jquery', expand: true},
{cwd: 'bower_components/angular-ui-router', src: ['release/*.js'], dest: 'public/lib/angular-ui-router', expand: true}
]
}
},
nodemon: {
dev: {
script: 'app.js',
options: {
args: ['--color'],
ignore: ['README.md', 'node_modules/**', '.DS_Store'],
ext: 'js',
watch: ['app', 'config', 'app.js', 'gruntfile.js'],
delay: 1000,
env: {
PORT: 3000
},
cwd: __dirname
}
}
},
concurrent: {
tasks: ['nodemon', 'watch'],
options: {
logConcurrentOutput: true
}
},
mochaTest: {
options: {
reporter: 'spec'
},
src: ['test/mocha/**/*.js']
},
env: {
test: {
NODE_ENV: 'test'
}
},
karma: {
unit: {
configFile: 'test/karma/karma.conf.js'
}
}
});
//Load NPM tasks
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-nodemon');
grunt.loadNpmTasks('grunt-concurrent');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-env');
grunt.loadNpmTasks('grunt-copy');
//Making grunt default to force in order not to break the project.
grunt.option('force', true);
//Default task(s).
grunt.registerTask('default', ['copy', 'jshint', 'concurrent']);
//Test task.
grunt.registerTask('test', ['env:test', 'mochaTest', 'karma:unit']);
};