-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbrunch-config.coffee
115 lines (102 loc) · 3.17 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
sysPath = require 'path'
production = process.env.BRUNCH_ENV is 'production'
# See http://brunch.io/#documentation for docs.
exports.config =
# Let's minify everything when production
optimize: production
# Configuration for npm
npm:
globals:
Backbone: 'backbone'
jQuery: 'jquery'
$: 'jquery'
underscore: 'lodash'
lodash: 'lodash'
_: 'lodash'
log: 'log-with-style'
'underscore.string': 'underscore.string'
'Hammer': 'hammerjs'
'backbone.hammer': 'backbone.hammer'
'backbone.collectionsubset': 'backbone.collectionsubset'
'velocity': 'velocity-animate'
# Chaplin: 'chaplin'
# Chapeau: 'chapeau'
static: ['node_modules/chaplin/chaplin.js', 'node_modules/chapeau/build/chapeau.js']
# Like to get notifications if available
notifications: true
# Where to make the magic !
#paths:
# public: 'public'
modules:
nameCleaner: (path)->
# Remove file extension added after brunch v2
path = path.substr(0, path.lastIndexOf('.')) or path
path.replace(/^app\//, '')
files:
javascripts:
joinTo:
# Better two have app.js AND vendor.js for caching reasons (vendor is not updated as often)
'js/app.js': /^(app)/
'js/vendor.js': /^(vendor|node_modules)/
order:
before: /^node_modules\/(jquery)/
after: /^node_modules\/(chapeau)/
stylesheets:
joinTo:
'css/app.css': /^(app)/
'css/vendor.css': /^(vendor|node_modules)/
order:
before: /^app(\/|\\)styles/
templates:
joinTo: 'js/app.js'
conventions:
# Ignore files finishing by .dev.* or .prod.* depending on the env
# Ignore files with filename starting by `_` or in a (sub)directory
# with name starting by `_`
ignored: (path) ->
(basename = sysPath.basename path)[0] is '_' or
/(^|\/)_.*/.test(sysPath.dirname path) or
(production and /.*\.dev\..*$/ or /.*\.prod\..*$/).test(basename)
assets: /(assets|font)/
plugins:
jaded:
staticPatterns: [
/^app(\/|\\)views(\/|\\)(.+)\.static\.dev\.jade$/
/^app(\/|\\)views(\/|\\)(.+)\.static\.prod\.jade$/
/^app(\/|\\)views(\/|\\)(.+)\.static\.jade$/
]
jade:
pretty: not production
compileDebug: not production
# Little hack to fix some issues stylus have with size of images
stylus:
paths: ['app/assets/images']
imports: ['nib', 'app/styles/_theme/index']
# Some conventions to keep code clean
coffeelint:
pattern: /^app\/.*\.coffee$/
options:
no_trailing_whitespace:
level: "warn"
no_interpolation_in_single_quotes:
level: "error"
no_backticks:
level: "warn"
no_empty_param_list:
level: "warn"
indentation:
value: 2
level: "error"
max_line_length:
value: 80
level: "warn"
colon_assignment_spacing:
spacing :
left: 0
right: 1
level: "warn"
prefer_english_operator:
level: "warn"
# AutoReload should not be enabled in production
autoReload:
enabled: not production