-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.coffee
More file actions
87 lines (76 loc) · 2.51 KB
/
Gruntfile.coffee
File metadata and controls
87 lines (76 loc) · 2.51 KB
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
# This is the main application configuration file. It is a Grunt
# configuration file, which you can learn more about here:
# https://github.com/cowboy/grunt/blob/master/docs/configuring.md
module.exports = (grunt) ->
grunt.initConfig
# compile coffee into js
coffeeify:
app:
files: [
src: ["app/application.coffee"]
dest: 'static/gitban.js'
]
# compile scss into css
sass:
compile:
files:
"public/css/index.css": [
"stylesheets/**/*.scss"
]
# compile hbs templates into js
ember_handlebars:
compile:
options:
processName: (name) ->
name
.replace('src/app/views/', '')
.replace('.hbs', '')
files:
"public/javascripts/templates.js": ["src/app/views/**/*.hbs"]
# concatenate vendor files
concat:
js:
src: [
"vendor/javascripts/handlebars.js",
"vendor/javascripts/ember.js",
"vendor/javascripts/ember-data.js",
"vendor/javascripts/recurly.js"
]
dest: "static/vendor.js"
# css:
# src: [
# "vendor/bootstrap.css",
# "public/css/index.css"
# ]
# dest: "static/vend.css"
# minify and uglify js
uglify:
app:
files:
"public/javascripts/app.min.js": ["public/javascripts/vendor.js", "public/javascripts/templates.js", "public/javascripts/app.js"]
# The watch task can be used to monitor the filesystem and execute specific
# tasks when files are modified.
watch:
app:
files: ["src/app/**/*.coffee"]
tasks: ["coffeeify"]
hbs:
files: ["src/app/views/**/*.hbs"]
tasks: ["ember_handlebars"]
vendor:
files: ["vendor/**/*.js"]
tasks: ["concat:vendor"]
scss:
files: ["styles/**/*.scss"]
tasks: ["sass", "concat:css"]
# load grunt libraries so that tasks can be executed
grunt.loadNpmTasks "grunt-contrib-concat"
grunt.loadNpmTasks "grunt-contrib-coffee"
grunt.loadNpmTasks "grunt-contrib-sass"
grunt.loadNpmTasks "grunt-contrib-watch"
grunt.loadNpmTasks "grunt-contrib-uglify"
grunt.loadNpmTasks "grunt-ember-handlebars"
grunt.loadNpmTasks "grunt-coffeeify"
# register grunt convenience tasks that execute other sets of tasks
grunt.registerTask "compile", ["concat:vendor", "coffeeify", "sass", "ember_handlebars", "concat:css"]
grunt.registerTask "production", ["compile", "uglify"]