You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[LESS](http://lesscss.org) and [Closure Compiler](https://developers.google.com/closure/compiler) preconfigured out of the box to intelligently minify your external facing CSS and JS files.
57
58
58
59
60
+
59
61
Create and run a Roosevelt app
60
62
===
61
63
@@ -181,6 +183,7 @@ Default directory structure
181
183
-`.gitignore`: a standard file which contains a list of files and folders to ignore if your project is in a git repo.
182
184
183
185
186
+
184
187
Default .gitignore
185
188
---
186
189
@@ -193,6 +196,7 @@ Some notable things ignored by default and why:
193
196
-`node_modules`: This folder will be auto-generated when you run the `npm install` step to set up your app. Since some modules you might include later in your app can be platform-specific and are compiled for your OS during the install step, it's generally <ahref='https://npmjs.org/doc/faq.html'>not recommended</a> to commit the `node_modules` folder to git.
194
197
195
198
199
+
196
200
Configure your app with parameters
197
201
===
198
202
@@ -244,6 +248,7 @@ App behavior parameters
244
248
- Default: `{}`
245
249
246
250
251
+
247
252
HTTPS parameters
248
253
---
249
254
@@ -268,6 +273,7 @@ HTTPS parameters
268
273
- Default: `false`
269
274
270
275
276
+
271
277
MVC parameters
272
278
---
273
279
@@ -284,13 +290,15 @@ MVC parameters
284
290
- Default: `mvc/controllers`
285
291
286
292
293
+
287
294
Utility library parameters
288
295
---
289
296
290
297
-`libPath`: Relative path on filesystem to where your optional utility library files are located. Defaults to `lib` if not set.
291
298
-`libPathNodeModulesSymlink`: Name of the symlink to make in `node_modules` pointing to your `lib` directory. Set to `false` to disable making this symlink. Defaults to `lib` if not set.
292
299
293
300
301
+
294
302
Error page parameters
295
303
---
296
304
@@ -302,6 +310,7 @@ Error page parameters
302
310
- Default: `503.js`
303
311
304
312
313
+
305
314
Statics parameters
306
315
---
307
316
@@ -320,8 +329,15 @@ Statics parameters
320
329
- Default: `.build/css`
321
330
-`jsPath`: Subdirectory within `staticsRoot` where your JS files are located. By default this folder will not be made public, but is instead meant to store unminified JS source files which will be minified and stored elsewhere when the app is started.
322
331
- Default: `js`
332
+
-`bundledJsPath`: Subdirectory within `staticsRoot` where you would like [browserify](http://browserify.org) to deposit bundled JS files it produces (if you use browserify).
333
+
- Default: `js/.bundled`
334
+
-`browserifyBundles`: Declare [browserify](http://browserify.org) bundles: one or more files in your `jsPath` for [browserify](http://browserify.org) to bundle via its [bundle method](https://github.com/substack/node-browserify#browserifyfiles--opts).
335
+
- Default: `[]`
336
+
- Example declaring one bundle: `[{outputFile: "bundle.js", files: ["landingPage.js", "main.js", "etc.js"], params: {someOpt: "someValue"}}]`
- Also by default the module [roosevelt-closure](https://github.com/kethinov/roosevelt-closure) is marked as a dependency in package.json.
326
342
-`jsCompilerWhitelist`: Whitelist of JS files to compile as an array. Leave undefined to compile all files. Supply a `:` character after each file name to delimit an alternate file path and/or file name for the minified file.
327
343
- Default: `undefined`
@@ -330,6 +346,7 @@ Statics parameters
330
346
- Default: `.build/js`
331
347
332
348
349
+
333
350
Public folder parameters
334
351
---
335
352
@@ -349,6 +366,7 @@ Public folder parameters
349
366
- Default: `false`
350
367
351
368
369
+
352
370
Events
353
371
---
354
372
@@ -381,6 +399,7 @@ Event list
381
399
-`res`: The [response object](http://expressjs.com/api.html#res.status) created by Express.
382
400
383
401
402
+
384
403
Making controller files
385
404
===
386
405
@@ -473,6 +492,7 @@ In addition to exposing a number of variables to Express and providing the MVC i
473
492
- Includes the [method-override](https://github.com/expressjs/method-override) middleware.
console.log(('📁 '+(app.get('package').name||'Roosevelt')+' making new directory '+app.get('appDir')+params.bundledJsPath.replace(app.get('appDir'),'')).yellow);
console.error(('❌ '+(app.get('appName')||'Roosevelt')+' failed to write new JS file '+app.get('appDir')+params.bundledJsPath+'/'+bundle.outputFile+' due to syntax errors in the source JavaScript\nError: '+err.message).red);
34
+
throwerr;
35
+
}
36
+
else{
37
+
console.log(('📝 '+(app.get('appName')||'Roosevelt')+' writing new JS file '+app.get('appDir')+params.bundledJsPath+'/'+bundle.outputFile).green);
console.error(('❌ '+(app.get('appName')||'Roosevelt')+' failed to include your JS compiler! Please ensure that it is declared properly in your package.json and that it has been properly insalled to node_modules.').red);
28
29
console.error(err);
29
-
}
30
-
31
-
// make js directory if not present
32
-
if(!fs.existsSync(app.get('jsPath'))){
33
-
fse.mkdirsSync(app.get('jsPath'));
34
-
console.log(('📁 '+(app.get('package').name||'Roosevelt')+' making new directory '+app.get('jsPath').replace(app.get('appDir'),'')).yellow);
30
+
callback();
31
+
return;
35
32
}
36
33
37
34
// make js compiled output directory if not present
0 commit comments