-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathgruntfile.js
108 lines (99 loc) · 3.69 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
module.exports = function(grunt) {
grunt.initConfig({
jshint: {
all: [
'gruntfile.js',
'routes/**',
'public/javascripts/app/**',
'public/javascripts/*.js'
]
},
uglify: {
options: {
compress: true,
report: true
},
vendors: {
files: {
'dist/public/javascripts/vendors/vendors.js': [
'public/javascripts/vendors/jquery.js',
'public/javascripts/vendors/underscore.js',
'public/javascripts/vendors/backbone.js',
'public/javascripts/vendors/backbone.marionette.js',
// 'public/javascripts/vendors/socket.io.js',
'public/javascripts/vendors/jquery.autosize.js',
'public/javascripts/vendors/jquery.timeago.js',
'public/javascripts/vendors/q.js',
'public/javascripts/vendors/html5editor.js'
]
}
},
admin: {
files: {
'dist/public/javascripts/app/admin/admin.js': [
'public/javascripts/init.js',
'public/javascripts/app/admin/models/*.js',
'public/javascripts/app/admin/collections/*.js',
'public/javascripts/app/admin/routers/*.js',
'public/javascripts/app/admin/views/*.js',
'public/javascripts/app/admin/*.js'
]
}
},
client: {
files: {
'dist/public/javascripts/app/client/client.js': [
'public/javascripts/init.js',
'public/javascripts/app/client/models/*.js',
'public/javascripts/app/client/collections/*.js',
'public/javascripts/app/client/routers/*.js',
'public/javascripts/app/client/views/*.js',
'public/javascripts/app/client/*.js'
]
}
}
},
imagemin: {
dist: {
options: {
optimizationLevel: 3
},
files: [
{expand: true, src: ['public/images/*'], dest: 'dist/'}
]
}
},
copy: {
target: {
files: [
{
expand: true,
src: [
'routes/**',
'public/**',
'!public/images/**',
'!public/javascripts/**',
'!public/stylesheets/*.styl',
'*.json',
'postit.js',
'public/javascripts/vendors/socket.io.js',
'views/**'
],
dest: 'dist/'
}
]
}
},
watch: {
files: ['routes/**', 'public/javascripts/*.js'],
tasks: ['jshint']
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-imagemin');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-copy');
// Default task(s).
grunt.registerTask('default', ['jshint', 'uglify', 'imagemin', 'copy']);
};