This repository has been archived by the owner on Jan 7, 2020. It is now read-only.
/
config.coffee
259 lines (218 loc) · 5.59 KB
/
config.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
module.exports =
###
Your project root directory (Optional)
@property {String}
@default `path.dirname require.main.filename`
###
root: ''
###
Determines logging to stdout/stderr on certain events.
###
logging:
startup : true
requests : true
errors : true
###
true : Minimal debug information is output to stdout.
Object :
files : true
render : true
watch : true
false : No debug information is output
###
debug: false
catchUncaught: true
###
HTTP server construction, with support for clustered servers.
###
server:
cluster : null # null, true, false
workers : 1 # if 1 or less will not use the cluster unless cluster is set to true
port : 80
host : '0.0.0.0'
method : 'port'
socket : ''
socketPerms : 0o0666
maxSockets : 20
###
Whether static file requests will be intercepted and served by `lactate`.
If this cannot resolve a static directory it will not serve static files.
true : ENABLED uses templater's saveTo path
String : ENABLED a relative path to `lance.root` or an absolute path
false : DISABLED
###
static: true
###
Whether to utilize gzip/deflate compression in responses
true : ENABLED with defaults as below
false : DISABLED
Object : ENABLED specify your own options to the createGzip and createDeflate zlib classes
{ createGzip: {}, createDeflate: {} }
###
compress:
createGzip : { level: 1 }
createDeflate : null
###
Busboy options for parsing form data, see: https://github.com/mscdex/busboy
###
busboy:
limits:
fileSize: 4 * 1024 * 1024 # bytes
###
Time before temp files (such as file uploads) will persist on the filesystem
before being deleted.
###
tempTimeout: 60000
###
routes: [
[ 'GET', '/:pattern/here', '?name?', (o) ->
o.next()
]
]
###
###
The templater governs a `findIn` directory.
The goal is to populate the `saveTo` folder with assets and
to serve markup from a templating language -- automatically.
###
templater:
###
Any default local variables that will be avaliable
to a templater. These are merged in with request-specific locals.
###
locals: {}
###
Browserify and Stylus bundling/rendering.
Destination is a relative path to the `saveTo` directory.
Source is a relative path from the `findIn` directory.
The source may be any of the engines below (besides the templater).
Example:
"destination.css" : "source.styl"
"destination.js" : "source.coffee"
###
bundle: {}
browserify:
extensions : [ '.js', '.coffee', '.cjsx' ]
debug : false # Source maps
###
Allows transforms to be specified as an array of arrays of arguements to the Browserify().transform function
eg. transform: [ [ require('coffeeify'), { global: true } ] ]
###
transform : null
###
Fallback paths for the below engines
###
saveTo: null
findIn: null
#
# ENGINES
#
###
The templating engine for rendering markup.
Defaults to ECT.js if no engine exists and `ect` is installed.
###
templater:
engine : undefined
ext : ''
findIn : null
minify : false
# If ECT.js be fallen back to, use these as the options when constructing the engine.
ect:
root : ''
ext : ''
cache : true
watch : true
open : '<?'
close : '?>'
stylus:
disabled: false
ext : '.styl'
engine : null
saveTo : null
findIn : null
minify : false
inherit : true # Inherits unset options from `css`
options :
'include css': true # Allows `@import 'some.css'` to concat
cache: false # Workaround for imports
coffee:
disabled: false
ext : '.coffee'
engine : null
saveTo : null
findIn : null
minify : false
inherit : true # Inherits unset options from `js`
options : {}
css:
disabled: false
ext : '.css'
saveTo : null
findIn : null
minify : false
inherit : true # Inherits unset options from `stylus`
js:
disabled: false
ext : '.js'
saveTo : null
findIn : null
minify : false
inherit : true # Inherits unset options from `coffee`
# Copy over any whitelisted file to the saveTo directory
assets:
disabled: false
saveTo : null
findIn : null
###
All files in the templater's directory are matched against this regex.
If there is a match, it is an asset.
###
match : /// \.(
png|jpg|gif|ico
| woff|eot|ttf|svg|pdf
)$ ///i
###
Any folder/file with this prefix is ignored
###
ignorePrefix: ''
#
# ADVANCED OPTIONS
#
###
Whether Stylus/Css/Js/CoffeeScript files and their bundled
dependencies are watche for changes to proc a recompile
###
watch: true
###
A debugger, for toggling functionality to diagnose issues
###
debugging:
fileWriting: true
###
Causes asset files to maintain their directory structure on render.
Assuming /findInDirectory/path/of/img.jpg we then save it accordingly:
true : /saveToDirectory/path/of/img.jpg
false : /saveToDirectory/img.jpg
###
preserveDirectory: true
###
Time between each watch `change` event on a particular file before the file is re-rendered
###
watchTimeout: 1500
###
Used to prevent frequent file re-writing
###
writeTimeout: 250
###
true : Enabled, initialized in the background
false : Disabled, templater.initialize() must be called manually
###
autoInitialize : false
###
Whether a Templater instance is added on construction.
true : lance.templater exists
false : lance.templater is undefined
###
autoConstruct : true
router:
cache: false