-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathGruntfile.coffee
120 lines (105 loc) · 2.09 KB
/
Gruntfile.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
module.exports = (grunt) ->
grunt.initConfig
clean:
build: [ 'build' ]
templateCache: [ 'build/templateCache.js' ]
copy:
src:
files: [
expand: true
cwd: 'public'
src: '**/*.{png,jpg,jpeg,gif,swf,svg,eot,ttf,otf,woff,woff2}'
dest: 'build'
]
swig_render:
src:
expand: true
cwd: 'views/pages'
ext: '.html'
src: [ '*.swig' ]
dest: 'build'
processhtml:
src:
files: [
expand: true
cwd: 'build/'
src: [ '*.html' ]
dest: 'build/'
]
less:
main:
options:
compress: true
relativeUrls: true
files:
'build/main.css': 'public/css/main.less'
imagemin:
src:
files: [
expand: true
cwd: 'public/'
src: [ '**/*.{png,jpg,gif}', '!**/bower_components/**' ]
dest: 'public/'
]
requirejs:
main:
options:
baseUrl: 'public/js'
mainConfigFile: 'public/js/main.js'
out: 'build/main.js'
name: 'main'
optimize: 'none'
preserveLicenseComments: false
stubModules: [
'text'
'css'
'cs'
'json'
]
include: ['almond']
excludeShallow: [
'cache',
'coffee-script'
'uglify-js'
]
ngtemplates:
templateCache:
cwd: 'public'
src: 'js/views/*.tpl'
dest: 'build/templateCache.js'
options:
htmlmin:
collapseBooleanAttributes: false
collapseWhitespace: true
removeAttributeQuotes: false
removeComments: true
removeEmptyAttributes: false
removeRedundantAttributes: true
removeScriptTypeAttributes: true
removeStyleLinkTypeAttributes: true
prefix: '/'
standalone: true
concat:
templateCache:
src: [ 'build/main.js', 'build/templateCache.js' ]
dest: 'build/main.js'
uglify:
options:
mangle: true
compress: true
src:
files:
'build/main.js': ['build/main.js']
require('load-grunt-tasks')(grunt)
grunt.registerTask 'build', [
'clean:build'
'copy'
'less'
'requirejs'
'ngtemplates'
'concat:templateCache'
'clean:templateCache'
'uglify'
'swig_render'
'processhtml'
]