-
Notifications
You must be signed in to change notification settings - Fork 0
/
moonbootsConfig.js
112 lines (109 loc) · 4.33 KB
/
moonbootsConfig.js
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
var stylizer = require('stylizer');
var config = require('getconfig');
var templatizer = require('templatizer');
// for reuse
var appDir = __dirname + '/client/';
var cssDir = __dirname + '/public/css/';
var stylDir = __dirname + '/public/styl/';
var templateDir = __dirname + '/templates/';
module.exports = {
// Tell the Hapi server what URLs the application should be served from.
// Since we're doing clientside routing we want to serve this from some type
// of wildcard url.
// examples:
// '/{p*}' - match everything that isn't matched by something more specific
// '/dashboard/{p*}' - serve the app at all routes starting with '/dashboard'
appPath: '/{p*}',
moonboots: {
// The base name of the javascript file served in the <script src="the_name.*.js">
//jsFileName: 'backyard-engineers',
// The base name of the css file served in the <link rel="stylesheet" src="the_name.*.css">
//cssFileName: 'backyard-engineers',
main: appDir + 'app.js',
developmentMode: config.isDev,
stylesheets: [
cssDir + 'bootstrap.min.css',
cssDir + 'main.css'
],
beforeBuildJS: function () {
//build our templates when in development environment
if(config.isDev) {
templatizer(templateDir, appDir + 'templates.js'); //pass in an entire folder of jade files, it will create a common js module in that folder structure, second argument is the output file
}
},
beforeBuildCSS: function (done) {
//if we are not in dev mode, bail
if(!config.isDev) return done();
stylizer({
infile: stylDir + 'main.styl',
outfile: cssDir + 'main.css',
development: true,
watch: stylDir + '/**/*.styl'
}, done);
}
}
};
/*
module.exports = {
// Tell the Hapi server what URLs the application should be served from.
// Since we're doing clientside routing we want to serve this from some type
// of wildcard url.
// examples:
// '/{p*}' - match everything that isn't matched by something more specific
// '/dashboard/{p*}' - serve the app at all routes starting with '/dashboard'
appPath: '/{p*}',
// The moonboots config
moonboots: {
// The base name of the javascript file served in the <script src="the_name.*.js">
//jsFileName: 'backyard-engineers',
// The base name of the css file served in the <link rel="stylesheet" src="the_name.*.css">
//cssFileName: 'backyard-engineers',
main: appDir + '/app.js',
developmentMode: config.isDev,
// Specify any non-commonjs libraries we wish to include.
// You can think of this as your list of <script> tags in your HTML.
// These will simply be included before any of your application code in the
// order you provide them. So for example, if you're using jQuery make sure
// you list any plugins after jQuery itself.
libraries: [
],
// Specify the stylesheets we want to bundle
stylesheets: [
//cssDir + '/bootstrap.css',
//cssDir + '/app.css'
],
browserify: {
debug: config.isDev
},
beforeBuildJS: function () {
// This re-builds our template files from jade each time the app's main
// js file is requested. Which means you can seamlessly change jade and
// refresh in your browser to get new templates.
//if (config.isDev) {
// templatizer(__dirname + '/templates', appDir + '/templates.js');
//}
}
//beforeBuildCSS: function (done) {
// We only want to do this in dev mode. If it's not in dev mode, this
// function will only be run once.
//if (!config.isDev) {
// done();
// return;
//}
// Re-compile stylus to css each time the app's main css file is requested.
// In addition there's a "watch" option that will make stylizer also be able
// to talk to livereaload (http://livereload.com/) browser plugins for sneakily
// refreshing styles without waiting for you to refresh or running/configuring
// the live reload app.
//stylizer({
// infile: cssDir + '/app.styl',
// outfile: cssDir + '/app.css',
// development: true,
// Beware there's an issue with watch on OSX that causes issues with
// watch if you're not running node 0.10.25 or later.
// watch: cssDir + '/** /*.styl' // if uncommented remove the space between /** and /
//}, done);
}
}
};
*/