-
Notifications
You must be signed in to change notification settings - Fork 6
/
Gruntfile.js
116 lines (111 loc) · 3 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
/*jshint node:true */
/*global module:false */
module.exports = function (grunt) {
'use strict';
grunt.initConfig({
jshint: {
files: ['Gruntfile.js', 'source/js/nv/*.js', 'source/js/nv/**/*.js'],
options: {
jshintrc: true,
globals: {
jQuery: true,
console: false
}
}
}
,
cssmin: {
'public/css/style.min.css': [
'source/css/bootstrap.css'
, 'source/css/bootstrap-responsive.css'
, 'source/css/font-awesome.css'
, 'source/css/tipsy.css'
, 'source/css/nv.css'
]
}
,
concat: {
libs: {
src: [
'source/js/lib/d3.v2.js'
, 'source/js/lib/crossfilter.js'
, 'source/js/lib/lodash.underscore.js'
, 'source/js/lib/backbone-min.js'
, 'source/js/lib/bootstrap.min.js'
, 'source/js/lib/jquery-ui-1.9.2.custom.js'
, 'source/js/lib/jquery.tipsy.js'
]
, dest: 'public/js/lib.min.js'
}
, app: {
src: [
'source/js/nv/main.js'
, 'source/js/nv/util.js'
, 'source/js/nv/models/*.js'
, 'source/js/nv/views/*.js'
, 'source/js/nv/router.js'
, 'source/js/legacy.js'
, 'source/js/parser/src/parser.js'
]
, dest: 'public/js/app.min.js'
}
}
,
uglify: {
libs: {
src: [
'source/js/lib/d3.v2.js'
, 'source/js/lib/crossfilter.js'
, 'source/js/lib/lodash.underscore.js'
, 'source/js/lib/backbone-min.js'
, 'source/js/lib/bootstrap.min.js'
, 'source/js/lib/jquery-ui-1.9.2.custom.js'
, 'source/js/lib/jquery.tipsy.js'
]
, dest: 'public/js/lib.min.js'
}
, app: {
src: [
'source/js/nv/main.js'
, 'source/js/nv/util.js'
, 'source/js/nv/models/*.js'
, 'source/js/nv/views/*.js'
, 'source/js/nv/router.js'
, 'source/js/legacy.js'
, 'source/js/parser/src/parser.js'
]
, dest: 'public/js/app.min.js'
}
}
,
copy: {
main: {
files: [
{src: ['source/index.html'], dest: 'public/'},
{src: ['source/js/lib/jquery-1.9.1.min.js'], dest: 'public/js/'},
{src: ['source/font/*'], dest: 'public/font/', expand: true},
{src: ['source/data/*'], dest: 'public/data/', expand: true}
]
}
}
,
watch: {
files: [
'<config:concat.app.src>'
, 'source/index.html'
, 'source/css/nv.css'
, 'source/css/tipsy.css'
]
, tasks: 'dev'
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-copy');
// production, run when grunt is run with no arguments
grunt.registerTask('default', ['jshint', 'cssmin', 'uglify', 'copy']);
// development - dont minify js
grunt.registerTask('dev', 'jshint cssmin concat copy');
grunt.registerTask('lint', 'jshint');
};