This repository was archived by the owner on May 7, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGruntfile.js
More file actions
91 lines (89 loc) · 2.88 KB
/
Gruntfile.js
File metadata and controls
91 lines (89 loc) · 2.88 KB
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
module.exports = function(grunt) {
//USING COMMON GRUNT PLUGINS
//watch
grunt.loadNpmTasks('grunt-contrib-watch');
//uglify
grunt.loadNpmTasks('grunt-contrib-uglify');
//jshint
grunt.loadNpmTasks('grunt-contrib-jshint');
//csslint
grunt.loadNpmTasks('grunt-contrib-csslint');
//compile less
grunt.loadNpmTasks('grunt-contrib-less');
//concat
grunt.loadNpmTasks('grunt-contrib-concat');
//configuration for grunt plugins
grunt.initConfig({
/* These are the configs for the less compiler taskrunner
* run less whenever css changes
*/
concat: {
dist: {
src: [ //js to be concatenated
//app
'public/app.js',
//config
'public/app/config.js',
//services
'public/app/services/dataService.js',
'public/app/services/mapService.js',
'public/app/services/stateService.js',
'public/app/services/userService.js',
//controllers
'public/app/controllers/login.js',
'public/app/controllers/main.js',
'public/app/controllers/map.js'
],
dest: 'public/build/kickstart.js'
}
},
/* These are the configs for the less compiler taskrunner
* run less whenever css changes
*/
less: {
development: {
files: {
'public/build/kickstart_css.css': [
//less to be compiled
'public/app/styles/main.less',
'public/app/styles/map.less',
'public/app/styles/login.less'
]
}
}
},
/* These are the configs for the watch taskrunner
* run uglify whenever js changes
*/
watch: {
js: {
//if any of these files change
files: ['public/app/**/*.js', 'public/*.js'],
//run these tasks
tasks: ['concat']
},
less: {
//if any of these files change
files: ['public/app/**/*.less'],
//run these tasks
tasks: ['less']
}
},
/* These are the configs for the css taskrunner
* run css lint before uglifying
*/
jshint: {
all: ['Gruntfile.js', 'public/app/**/*.js']
},
csslint: {
strict: {
options: {
import: 2
},
src: ['public/build/*.css']
}
}
});
//a new task called build uglifies everything
grunt.registerTask('build', ['less', 'concat']);
}