-
Notifications
You must be signed in to change notification settings - Fork 54
/
Gruntfile.js
executable file
·125 lines (106 loc) · 3.07 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
module.exports = function(grunt) {
// Sass base
var sassPath = 'src/theme',
jsPath = 'src',
appPath = jsPath + '/js';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
separator: ';'
},
dist: {
src: [
// jQuery
jsPath + '/lib/required/jquery-1.11.1.js',
// underscore
jsPath + '/lib/required/underscore-min.js',
// backbone
jsPath + '/lib/required/backbone.dev.js',
jsPath + '/lib/required/backbone.rpc.min.js',
// All our enabled js
jsPath + '/lib/enabled/*.js',
// application js
appPath + '/utils.js',
appPath + '/app.js',
// helpers
appPath + '/helpers/*.js',
// application models
appPath + '/models/*.js',
// application controllers
appPath + '/controllers/*.js',
// application collections - need to be loaded in order
appPath + '/collections/xbmc.js',
appPath + '/collections/video.js',
appPath + '/collections/audio.js',
appPath + '/collections/files.js',
appPath + '/collections/pvr.js',
// application views
appPath + '/views/*.js',
// addons
appPath + '/addons/*.js'
],
dest: 'dist/<%= pkg.name %>.js'
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> by Jeremy Graham - built on <%= grunt.template.today("dd-mm-yyyy") %> */\n'
},
dist: {
files: {
'dist/<%= pkg.name %>.min.js': ['<%= concat.dist.dest %>']
}
}
},
jshint: {
files: ['Gruntfile.js', appPath + '/*.js', appPath + '/*/*.js'],
options: {
// options here to override JSHint defaults
globals: {
jQuery: true,
console: true,
module: true,
document: true
}
}
},
compass: {
dist: {
options: {
// The path Compass will run from.
basePath: sassPath
// To use with bundled gems, uncomment below
//, bundleExec: true
}
}
},
browser_sync: {
dev: {
bsFiles: {
src: 'dist/theme/css/**/*.css'
},
options: {
watchTask: true,
injectChanges: true
}
}
},
// Watch tasks
watch: {
files: [sassPath + '/sass/**/*.scss', '<%= jshint.files %>'],
tasks: ['compass', 'jshint']
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-browser-sync');
grunt.registerTask('test', ['jshint']);
// watch task (uncomment during dev)
grunt.registerTask('default', ['browser_sync', 'watch', 'jshint', 'concat', 'uglify']);
// build task (uncomment for build)
grunt.registerTask('build', ['jshint', 'concat', 'uglify']);
};