-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathGruntfile.coffee
131 lines (126 loc) · 3.57 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
module.exports = (grunt) ->
# configure the tasks
grunt.initConfig
browserify:
options:
debug: true
transform: ['coffee-reactify']
extensions: ['.jsx', '.cjsx', '.coffee']
dev:
options:
alias: ['react:'] # Make React available externally for dev tools
browserifyOptions:
debug: true
src: ['client/scripts/app.cjsx']
dest: 'build/static/js/app.js'
production:
options:
debug: false
src: '<%= browserify.dev.src %>'
dest: '<%= browserify.dev.dest %>'
coffee:
server:
options:
bare: true
files: [
{
expand: true
cwd: 'server/'
src: ['*.coffee']
dest: 'build/'
ext: '.js'
}
]
sass:
dev:
options:
sourcemap: 'inline'
files:
'build/static/css/app.css': 'client/styles/app.sass'
concat:
options:
separator: ';'
otr:
src: [
'client/scripts/vendor/otr/dep/salsa20.js',
'client/scripts/vendor/otr/dep/bigint.js',
'client/scripts/vendor/otr/dep/crypto.js',
'client/scripts/vendor/otr/dep/eventemitter.js',
'client/scripts/vendor/otr/otr.js'
]
dest: 'build/static/js/otr.js'
copy:
server:
cwd: 'server/'
src: [ 'views/**/*' ]
dest: 'build/'
expand: true
deployment:
cwd: 'deployment/'
src: [ 'manifest.yml', 'package.json' ]
dest: 'build/'
expand: true
watch:
styles:
files: 'client/styles/**/*'
tasks: [ 'sass:dev' ]
scripts:
files: 'client/scripts/**/*'
tasks: [ 'browserify:dev' ]
otr:
files: 'client/scripts/vendor/**/*'
tasks: [ 'concat:otr' ]
server:
files: 'server/**/*'
tasks: [ 'express:node_server:stop', 'coffee:server', 'copy:server', 'express:node_server' ]
options:
spawn: false
debounceDelay: 2000
browserSync:
dev:
bsFiles:
src : [
'build/*.html'
'build/*.js'
'build/static/**/*'
]
options:
watchTask: true
proxy: 'localhost:9000'
ghostMode: false
watchOptions:
debounceDelay: 3000
open: false
reloadOnRestart: false
env:
dev:
NODE_ENV : 'development'
build:
NODE_ENV : 'production'
clean:
build: src: 'build'
express:
node_server:
options:
port: 9000
node_env: 'development'
script: 'build/index.js'
nodeunit:
server: ['server/test/*_test.coffee']
options:
reporter: 'default'
grunt.loadNpmTasks 'grunt-browserify'
grunt.loadNpmTasks 'grunt-contrib-copy'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-browser-sync'
grunt.loadNpmTasks 'grunt-env'
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-contrib-clean'
grunt.loadNpmTasks 'grunt-contrib-sass'
grunt.loadNpmTasks 'grunt-express-server'
grunt.loadNpmTasks 'grunt-contrib-nodeunit'
grunt.loadNpmTasks 'grunt-contrib-concat'
grunt.registerTask 'dev', ['browserify:dev', 'sass:dev', 'copy:server', 'concat:otr']
grunt.registerTask 'server', ['clean:build', 'coffee:server', 'copy:server', 'copy:deployment']
grunt.registerTask 'build', ['server', 'dev']
grunt.registerTask 'reloading', ['server', 'dev', 'express:node_server', 'browserSync', 'watch']