-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbrunch-config.coffee
85 lines (77 loc) · 2.27 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
module.exports = config:
conventions:
assets: /^src\/assets/
ignored: ['hooks', 'plugins', 'resources', 'www']
paths:
public: 'www'
watched: ['src']
files:
javascripts:
joinTo:
'angular.js': /^node_modules\/@angular/,
'ionic.js': /^node_modules\/(@ionic|ionic-angular)/,
'types.js': /^node_modules\/@types/,
'crypto.js': /^node_modules\/(tweet|scrypt)/,
'vendor.js': (path) ->
path.startsWith('node_modules') &&
!path.startsWith('node_modules/@angular') &&
!path.startsWith('node_modules/@ionic') &&
!path.startsWith('node_modules/ionic') &&
!path.startsWith('node_modules/@types') &&
!path.startsWith('node_modules/tweet') &&
!path.startsWith('node_modules/scrypt')
'main.js': /^src/
order:
after: [/\.html$/, /\.css$/]
stylesheets:
joinTo:
'app.css': /(s?css)$/
templates: joinTo: 'templates.js'
plugins:
uglify:
mangle: true
compress: true
ignored: /main\.js/
inlineCss: {
html: true
},
babel:
presets: ['es2015','stage-0']
brunchTypescript: {
ignoreErrors: true
},
copycat: {
"fonts" : ["node_modules/ionic-angular/fonts"],
verbose : false,
onlyChanged: true
}
hooks:
preCompile: () ->
console.log("Pre-compilation: generation de ionic.css...")
sass = require('node-sass');
fs = require('fs')
if (!fs.existsSync('www'))
fs.mkdirSync('www')
return new Promise((res, rej) ->
sass.render({
data: '$font-path: "/fonts"; @import "ionic.build.default";',
outFile: 'www/ionic.css',
sourceMap: true,
includePaths: [
"node_modules/ionic-angular/themes",
"node_modules/ionic-angular/fonts",
"node_modules/ionicons/dist/scss"
]
}, (err, result) ->
if (err)
return rej(err)
require('fs').writeFileSync('www/ionic.css', result.css.toString('utf8'))
require('fs').writeFileSync('www/ionic.css.map', result.map.toString('utf8'))
return res()
);
)
overrides:
production:
sourceMaps: true
server:
hostname: '127.0.0.1'