This repository has been archived by the owner on Jul 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
brunch-config.coffee
executable file
·140 lines (128 loc) · 3.79 KB
/
brunch-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
# Brunch-config.coffee meta file
#
Sites = require './sitedef.json'
S={}
for aSite in Sites.results
aSite.fields.siteId = aSite.id
S[aSite.name] = aSite.fields
Sites = S
# ??? path = require 'path'
siteName = process.env.SITE
if !siteName
console.log "Must specify env on cmd line: SITE='' brunch ..."
process.exit()
else
console.log "Processing #{siteName} with brunch"
theSite = Sites[siteName]
if !theSite
console.log "invalid site #{siteName} -- Not in sites.coffee"
process.exit()
theResult =
# See http://brunch.io/#documentation for docs.
paths:
public: "domains/#{siteName}/public"
watched:[
"domains/#{siteName}/payload-"
"domains/#{siteName}/templates"
'vendor'
'app'
]
conventions:
ignored: (path) -> /\.c9|\.git/.test path
assets: (path)->
console.log "JAH PATH", path
if path.match 'templates'
console.log "JAH", path
return true
return true if path.match 'css/'
return true if path.match 'fonts/'
return true if path.match 'assets/'
return false
modules:
autoRequire:
js: [ "halvalla/lib/halvalla-mithril.js" ]
css: [
siteName
"#{siteName}/payload-/run-time.css"
],
"css/vendor.css": [
"normalize"
"blaze"
"ace-css"
"basscss-grid"
"bootstrap"
]
nameCleaner: (path) =>
c=path.replace /^app\//, ''
c=c.replace ///^assets/#{siteName}///, ''
c=c.replace ///^domains\////, ''
c=c.replace ///#{siteName}[\/]payload-///,'payload-'
c=c.replace ///#{siteName}[\/]templates///,''
console.log "path Cleaner: #{path} - #{c}" if path.match "nothing to see here"
return c
files:
javascripts:
joinTo:
'assets/js/app.js': [/^app/,///domains/#{siteName}\/payload-/// ]
'assets/js/vendor.js': (f)->
pattern= ///vendor|bower_components|node_modules///
#console.log pattern
result = f.match pattern
#console.log "matching #{f}: #{result}"
return result
order:
after: /helpers\//
stylesheets:
order: # must use full names not anyMatch syntax
before: "node_modules/blaze/scss/dist/blaze.min.css"
after: [ "node_modules/ace-css/css/ace.css", "node_modules/basscss-grid/css/grid.css", "node_modules/bootstrap/dist/css/bootstrap.min.css"]
joinTo:
'assets/css/app.css': [/^app/,///domains\/#{siteName}\/payload-///]
'assets/css/vendor.css': ///^vendor|^bower_components|^node_modules///
templates:
joinTo:
'assets/js/app.js': /^app/
conventions:
vendor:
///(^bower_components|node_modules|vendor)[\/]///
npm:
enabled: true
globals:
loglevel: "loglevel"
#mui: "mui"
#_: "underscore"
jQuery: "jquery"
fontFaceObserver: 'font-face-observer'
styles: {
"blaze": ["scss/dist/blaze.min.css"]
"bootstrap": ["dist/css/bootstrap.min.css"]
"ace-css": [ "css/ace.css" ]
"basscss-grid": [ "css/grid.css" ]
}
plugins:
'halvalla':
destination: "domains/#{siteName}/public/"
allStories: "./app/assets/assets/allstories.json"
order: [ 'coffeescript','halvalla', 'babel' ]
uglify:
ignored: /app.js/
gzip:
optimize: "optimize"
paths:
javascript: 'assets/js'
stylesheet: 'assets/css'
removeOriginalFiles: false
renameGzipFilesToOriginalFiles: false
babel:
presets: [ 'latest', 'react']
plugins: [
# ["babel-plugin-root-import", rootPathPrefix: "" ]
# ["minify-dead-code-elimination"]
]
scss:
mode: 'ruby' # set to 'native' to force libsass
server:
noPushState: true
stripSlashes: true
#console.log theResult
exports.config = theResult