-
Notifications
You must be signed in to change notification settings - Fork 3
/
Gruntfile.coffee
97 lines (90 loc) · 2.85 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
module.exports = (grunt) ->
libs = [
'client/js/libs/jquery.js'
'client/js/libs/handlebars.runtime.js'
'client/js/libs/ember.js'
'client/js/libs/bootstrap.js'
'client/js/libs/typeahead.jquery.js'
'client/js/libs/jspdf.debug.js'
]
grunt.initConfig
pkg: grunt.file.readJSON 'package.json'
couchapp:
qbtd:
db: require './scripts/database'
app: 'server/server.coffee'
coffee:
compile:
files:
'client/js/app.js': [
'client/coffee/app.coffee'
'client/coffee/db/couch.coffee'
'client/coffee/app/*'
]
options:
sourceMap: true
pouch:
files:
'client/js/app.js': [
'client/coffee/app.coffee'
'client/coffee/db/pouch.coffee'
'client/coffee/app/*'
]
options:
sourceMap: true
emblem:
compile:
files:
'client/js/templates.js': 'client/**/*.emblem'
options:
root: 'client/emblem/'
dependencies:
jquery: 'client/js/libs/jquery.js'
ember: 'client/js/libs/ember.js'
emblem: 'client/js/libs/emblem.js'
handlebars: 'client/js/libs/handlebars.min.js'
concat:
libs:
src: libs
dest: 'client/js/libs.js'
pouch:
src: libs.concat 'client/js/libs/pouchdb-nightly.js'
dest: 'client/js/libs.js'
copy:
main:
cwd: 'bower_components'
src: [
'bootstrap/dist/js/*'
'ember/ember.*'
'emblem/dist/*'
'handlebars/handlebars.*.js'
'jquery/dist/*.js'
'typeahead.js/dist/typeahead.jquery.*'
'pouchdb/dist/*.js'
'jspdf/dist/*.js'
]
dest: 'client/js/libs/'
flatten: true
expand: true
watch:
script:
files: ['client/coffee/*', 'client/emblem/**', 'client/css/*', 'server/**/*']
tasks: 'default'
style:
files: '**/*.less'
tasks: 'default'
html:
files: 'client/*.html'
tasks: 'default'
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-contrib-copy'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-contrib-concat'
grunt.loadNpmTasks 'grunt-emblem'
grunt.loadNpmTasks 'grunt-couchapp'
grunt.registerTask 'generateGamesData', 'Generate fake data', require('./scripts/generate.coffee').generateGames
grunt.registerTask 'generateData', 'Generate fake data', require('./scripts/generate.coffee').generateEverything
grunt.registerTask 'default', ['concat:libs', 'coffee:compile', 'emblem', 'couchapp']
grunt.registerTask 'pouch', ['concat:pouch', 'coffee:pouch', 'emblem', 'couchapp']
grunt.registerTask 'generate', ['generateData', 'default']
grunt.registerTask 'generateGames', ['generateGamesData', 'default']