-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.coffee
59 lines (56 loc) · 1.73 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
templateDir = 'src/templates/'
handlebarsPath = templateDir + '*.hbs'
module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON('package.json')
clean: ['compiled/']
coffee:
compile:
options:
sourceMap: true
files:
'compiled/js/app.js': 'src/js/app.coffee'
'compiled/js/cribbage.js': 'src/js/cribbage.coffee'
'compiled/js/player.js': 'src/js/player.coffee'
'compiled/js/deck.js': 'src/js/deck.coffee'
'compiled/js/card.js': 'src/js/card.coffee'
copy:
main:
files: [
{dest: 'compiled/index.html', src: 'src/index.html'},
{dest: 'compiled/js/main.js', src: 'src/js/main.js'}
]
handlebars:
compile:
options:
namespace: 'templates'
amd: true
processName: (filename) ->
return filename.split(templateDir)[1].split('.hbs')[0]
files:
'compiled/js/templates.js': handlebarsPath
sass:
dist:
files:
'compiled/css/style.css': 'src/css/base.scss'
watch:
coffee:
files: ['src/js/**/*.coffee']
tasks: ['coffee']
copy:
files: ['src/index.html']
tasks: ['copy']
handlebars:
files: [handlebarsPath]
tasks: ['handlebars']
sass:
files: ['src/css/**/*.scss']
tasks: ['sass']
grunt.loadNpmTasks 'grunt-contrib-clean'
grunt.loadNpmTasks 'grunt-contrib-copy'
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-contrib-handlebars'
grunt.loadNpmTasks 'grunt-contrib-sass'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.registerTask 'default',
['clean', 'coffee', 'copy', 'handlebars', 'sass']