-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
92 lines (84 loc) · 3.89 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
module.exports = function(grunt) {
grunt.initConfig({
dirs: {
// Configurable paths
src: 'src/sa_web/static',
dest: 'src/sa_web/static/dist'
},
concat: {
distjs: {
options: {separator: ';'},
files: {
'<%= dirs.dest %>/preload.js': ['<%= dirs.src %>/js/utils.js',
'<%= dirs.src %>/js/template-helpers.js'],
'<%= dirs.dest %>/app.js': ['<%= dirs.src %>/js/handlebars-helpers.js',
'<%= dirs.src %>/js/models.js',
'<%= dirs.src %>/js/views/pages-nav-view.js',
'<%= dirs.src %>/js/views/auth-nav-view.js',
'<%= dirs.src %>/js/views/activity-view.js',
'<%= dirs.src %>/js/views/app-view.js',
'<%= dirs.src %>/js/views/layer-view.js',
'<%= dirs.src %>/js/views/map-view.js',
'<%= dirs.src %>/js/views/support-view.js',
'<%= dirs.src %>/js/views/survey-view.js',
'<%= dirs.src %>/js/views/place-detail-view.js',
'<%= dirs.src %>/js/views/place-form-view.js',
'<%= dirs.src %>/js/views/place-list-view.js',
'<%= dirs.src %>/js/views/geocode-address-view.js',
'<%= dirs.src %>/js/routes.js']
}
},
distcss: {
options: {separator: '\n'},
files: {
'<%= dirs.dest %>/app.css': ['<%= dirs.src %>/css/normalize.css',
'<%= dirs.src %>/css/default.css',
'<%= dirs.src %>/css/custom.css']
}
}
},
uglify: {
distjs: {
files: {
'<%= dirs.dest %>/libs.min.js': ['<%= dirs.src %>/libs/underscore.js',
'<%= dirs.src %>/libs/backbone.js',
'<%= dirs.src %>/libs/backbone.marionette.js',
'<%= dirs.src %>/libs/handlebars-v3.0.3.js',
'<%= dirs.src %>/libs/moment-with-locales.min.js',
'<%= dirs.src %>/libs/json2.js',
'<%= dirs.src %>/libs/leaflet.argo.js',
'<%= dirs.src %>/libs/binaryajax.js',
'<%= dirs.src %>/libs/exif.js',
'<%= dirs.src %>/libs/load-image.js',
'<%= dirs.src %>/libs/canvas-to-blob.js',
'<%= dirs.src %>/libs/spin.min.js',
'<%= dirs.src %>/libs/gatekeeper.js',
'<%= dirs.src %>/libs/swag.min.js',
'<%= dirs.src %>/libs/jquery.scrollTo.js',
'<%= dirs.src %>/libs/handlebars-helpers.js']
}
}
},
copy: {
distcssimages: {
expand: true,
cwd: '<%= dirs.src %>/css/',
src: '{,*/}*.{gif,jpeg,jpg,png,svg,webp}',
dest: '<%= dirs.dest %>/',
},
},
watch: {
files: ['<%= jshint.files %>'],
tasks: ['jshint']
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.registerTask('default', [
'concat',
'uglify',
'copy'
]);
};