-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
73 lines (73 loc) · 1.65 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
module.exports = (grunt) ->
grunt.loadNpmTasks 'grunt-browserify'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-haml'
grunt.loadNpmTasks 'grunt-contrib-sass'
grunt.loadNpmTasks 'grunt-karma'
grunt.loadNpmTasks 'grunt-newer'
grunt.initConfig {
pkg: grunt.file.readJSON('package.json'),
watch: {
haml: {
files: ['**/*.haml']
tasks: ['newer:haml', 'karma:unit:run']
},
coffee: {
files: ['scripts/*.coffee', 'test/*.coffee']
tasks: ['browserify', 'karma:unit:run']
}
sass: {
files: ['style.scss'],
tasks: ['sass']
}
},
karma: {
unit: {
configFile: 'karma.conf.js',
background: true
}
},
sass: {
dist: {
src: 'style.scss',
dest: 'css/style.css'
}
},
haml: {
index: {
src: 'index.html.haml',
dest: 'index.html'
options: {
language: 'ruby'
}
},
templates: {
files: [{
expand: true,
src: ['templates/*.haml'],
ext: '.html'
}]
options: {
language: 'ruby'
}
}
},
browserify: {
dist: {
files: {
'scripts/bundle.js': ['scripts/*.coffee'],
'test/bundle.js': ['test/*.coffee']
},
options: {
transform: ['coffeeify'],
fullPaths: true,
aliasMappings: {
cwd: 'scripts',
src: ['**/*.coffee', '**/*.js', '!bundle.js']
}
}
}
}
}
grunt.registerTask 'default', ['karma', 'watch']