-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.coffee
89 lines (76 loc) · 2.22 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
module.exports = (grunt) ->
grunt.initConfig
directories:
dev: 'build'
release: 'release'
build: '<%= directories.dev %>'
build$release: '<%= directories.release %>'
browserify:
app:
files: { '<%= directories.build %>/js/app.js': ['app/**/*.coffee', 'lib/**/*.coffee'] }
options:
transform: ['coffeeify']
debug: true
debug$release: false
fast: true
clean:
dev: '<%= directories.dev %>'
release: '<%= directories.release %>/*'
target: '<%= directories.build %>/*'
coffeelint:
app: ['lib/*.coffee']
gruntfile: 'Gruntfile.coffee'
options: max_line_length: { value: 120 }
connect:
server: options: base: '<%= directories.build %>'
copy:
app:
expand: true
cwd: 'app'
dest: '<%= directories.build %>'
src: ['**/*', '!**/*.coffee', '!**/*.{coffee,jade,scss}']
filter: 'isFile'
'gh-pages':
options: base: '<%= directories.release %>'
src: '**/*'
jade:
app:
expand: true
cwd: 'app'
src: '**/*.jade'
dest: '<%= directories.build %>'
ext: '.html'
options:
pretty: true
pretty$release: false
sass:
app:
expand: true
cwd: 'app'
dest: '<%= directories.build %>'
src: ['css/**/*.scss', '!**/_*']
ext: '.css'
filter: 'isFile'
options:
sourcemap: true
_release:
sourcemap: false
style: 'compressed'
update:
tasks: ['browserify', 'copy', 'jade', 'sass']
watch:
options:
livereload: true
gruntfile:
files: 'Gruntfile.coffee'
tasks: ['coffeelint:gruntfile', 'build']
jade: {}
sass: {}
scripts:
files: ['app/**/*.coffee', 'node_modules/schoen/dist/**/*.{js,coffee}']
tasks: ['browserify']
require('load-grunt-tasks')(grunt)
grunt.registerTask 'build', ['clean:target', 'browserify', 'copy', 'jade', 'sass']
grunt.registerTask 'build:release', ['contextualize:release', 'build']
grunt.registerTask 'deploy', ['build:release', 'gh-pages']
grunt.registerTask 'default', ['update', 'connect', 'autowatch']