This repository has been archived by the owner on May 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.coffee
135 lines (124 loc) · 3.07 KB
/
Gruntfile.coffee
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
126
127
128
129
130
131
132
133
134
135
module.exports = (grunt) ->
# Project configuration
grunt.initConfig
pkg: grunt.file.readJSON('package.json'),
coffee:
compile:
options:
join: true
files:
'js/main.js': ['coffee/*.coffee']
handlebars:
compile:
options:
namespace: 'YANTRE.templates'
processName: (filename) ->
file = filename.split('/')[1]
file[0..file.length-5].toLowerCase()
files:
"js/template.js": ["template/*.hbs"]
less:
dev:
files:
"css/main.css": "less/main.less"
prod:
options:
yuicompress: true
files:
"css/main.css": "less/main.less"
watch:
coffee:
files: 'coffee/*.coffee'
tasks: ['coffee']
less:
files: 'less/*.less'
tasks: ['less:dev']
handlebars:
files: 'template/*.hbs'
tasks: ['handlebars']
compress:
main:
options:
archive: 'yantre.zip'
mode: 'zip'
pretty: true
files: [
dest: 'yantre/'
src: [
'css/main.min.css'
'fonts/**'
'icon/*'
'images/*'
'js/main.min.js'
'manifest.json'
'index.html'
]
]
cssmin:
minify:
options:
report: 'min'
files:
'css/main.min.css': ['css/flipclock.css', 'css/jquery.bxslider.css', 'css/main.css']
uglify:
minify:
options:
report: 'min'
files:
'js/main.min.js': [
'js/jquery-2.0.2.min.js'
'js/jquery.bxslider.min.js'
'js/moment.min.js'
'js/handlebars.runtime.js'
'js/flipclock/flipclock.min.js'
'js/flipclock/faces/TwelveHourClock.js'
'js/flipclock/face/TwentyFourHourClock.js'
'js/template.js'
'js/main.js'
]
jade:
dev:
options:
pretty: true
data:
prod: false
files:
"index.html": "index.jade"
prod:
options:
data:
prod: true
files:
"index.html": "index.jade"
clean: ["css/main.min.css", "js/main.min.js"]
# Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-contrib-handlebars'
grunt.loadNpmTasks 'grunt-contrib-less'
grunt.loadNpmTasks 'grunt-contrib-compress'
grunt.loadNpmTasks 'grunt-contrib-cssmin'
grunt.loadNpmTasks 'grunt-contrib-uglify'
grunt.loadNpmTasks 'grunt-contrib-jade'
grunt.loadNpmTasks 'grunt-contrib-clean'
# tasks
grunt.registerTask 'default', ['watch']
grunt.registerTask 'build:dev', [
'jade:dev'
'coffee'
'handlebars'
'less:dev'
]
grunt.registerTask 'build:prod', [
'jade:prod'
'coffee'
'handlebars'
'less:prod'
'cssmin'
'uglify'
]
grunt.registerTask 'package', [
'build:prod'
'compress'
'clean'
]