forked from redditbooru/reddit-booru
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
executable file
·82 lines (79 loc) · 2.82 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
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
separator: ';'
},
dist: {
src: [
'static/js/dev/lib/jquery.min.js',
'static/js/dev/lib/underscore.min.js',
'static/js/dev/lib/backbone.min.js',
'static/js/dev/lib/handlebars.runtime.js',
'static/js/dev/model/*.js',
'static/js/dev/controls/*.js',
'static/js/templates.js',
'static/js/dev/view/*.js',
'static/js/dev/Uploader.js',
'static/js/dev/Routes.js',
'static/js/dev/App.js'
],
dest: 'static/js/<%= pkg.name %>.js'
}
},
uglify: {
options: {
banner: '/* <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
dist: {
files: {
'static/js/<%= pkg.name %>.min.js': ['<%= concat.dist.dest %>']
}
}
},
sass: {
dist: {
files: {
'static/scss/styles.css': 'static/scss/styles.scss',
'static/scss/mobile.css': 'static/scss/mobile.scss'
}
}
},
handlebars: {
compile: {
options: {
namespace: 'RB.Templates',
wrapped:true,
processName: function(filename) {
filename = filename.split('/');
filename = filename[filename.length - 1];
return filename.split('.')[0];
}
},
files: {
'static/js/templates.js': 'views/*.handlebars'
}
}
},
watch: {
files: [
'static/js/dev/lib/*.js',
'static/js/dev/model/*.js',
'static/js/dev/view/*.js',
'static/js/dev/controls/*.js',
'static/js/dev/*.js',
'views/*.handlebars',
'views/partials/*.handlebars',
'static/scss/*.scss'
],
tasks: ['handlebars', 'concat', 'sass']
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-handlebars');
grunt.loadNpmTasks('grunt-sass');
grunt.registerTask('default', ['handlebars', 'sass', 'concat', 'uglify']);
};