-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathGruntfile.coffee
91 lines (80 loc) · 1.88 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
module.exports = (grunt) ->
grunt.initConfig
# variables
pkg:
grunt.file.readJSON("package.json")
projDir:
'./project'
outDir:
'./out'
clean:
main: ['<%= outDir %>']
coffee:
dev:
files: [
expand: true
ext: '.js'
cwd: "<%= projDir %>/coffee"
src: ['**/*.coffee']
dest: '<%= outDir %>/js'
]
options:
sourceMap: true
bare: true
dist:
files: [
expand: true
ext: '.js'
cwd: "<%= projDir %>/coffee"
src: ['**/*.coffee']
dest: '<%= outDir %>/js'
]
options:
sourceMap: true # NB
bare: true
requirejs:
compile:
options:
baseUrl: '<%= outDir %>/js/'
mainConfigFile: '<%= outDir %>/js/boot.js'
name: 'boot'
optimize: 'none'
include: ['lib/almond-0.3.0']
out: "<%= outDir %>/js/boot-built.js"
sync:
main:
files: [
cwd:'<%= projDir %>/assets'
src: ['**']
dest: '<%= outDir %>'
]
verbose: true
watch:
coffee:
files: ['<%= projDir %>/coffee/**/*.coffee']
tasks: ['newer:coffee:dev'] # , 'notify:watch_coffee']
sync:
files: ['<%= projDir %>/assets/**/*']
tasks: ['sync', 'notify:watch_sync']
notify:
watch_coffee:
options:
title: 'CoffeeScript'
message: 'Updated'
watch_requirejs:
options:
title: 'Require.js'
message: 'Concatenated'
watch_sync:
options:
title: 'Files'
message: 'Updated'
grunt.loadNpmTasks 'grunt-contrib-clean'
grunt.loadNpmTasks "grunt-contrib-coffee"
grunt.loadNpmTasks "grunt-contrib-requirejs"
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks "grunt-newer"
grunt.loadNpmTasks 'grunt-notify'
grunt.loadNpmTasks "grunt-sync"
grunt.registerTask "default", ["clean", "coffee:dev", "sync", "watch"] # watch > sync is not fully working?...
grunt.registerTask "dist", ["clean", "coffee:dist", "sync", "requirejs"]