-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
118 lines (101 loc) · 2.34 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
module.exports = (grunt) ->
grunt.initConfig
autoprefixer:
options: ['> 5%']
build: files: [
expand: true
cwd: '.tmp/',
src: '**/*.css',
dest: '.tmp/'
]
browserify:
dev:
files: '.tmp/bundle.js': [ 'src/index.js']
options:
watch: true
browserifyOptions: { debug: true }
transform: [
'hintify'
[ 'stringify', 'extensions': [ '.html' ] ]
'browserify-ngannotate'
'envify'
]
www:
files: '.tmp/bundle.js': [ 'src/index.js']
options: transform: [
'hintify'
[ 'stringify', 'extensions': [ '.html' ], "minify": true, ]
'browserify-ngannotate'
'envify'
'uglifyify'
]
clean:
www: files: [ dot: true, src: [ 'www/*','!www/.git' ], ]
tmp: files: [ dot: true, src: [ '.tmp' ], ]
copy:
options: onlyIf: 'modified'
fonts: src: 'node_modules/*/fonts/*', dest: 'www/'
images:
expand: true,
cwd: 'src',
dest: 'www',
src: '**/*.{png,gif,jpg,svg}'
index: src: 'src/index.html', dest: 'www/index.html'
connect:
options:
hostname: '0.0.0.0', port: 9000, livereload: 19000 # CHANGE ME
livereload: options: base: [ '.tmp','src','.' ]
filerev: build: src: 'www/*.{js,css}'
less: build:
files: '.tmp/bundle.css': 'src/index.less'
options:
sourceMap: true
sourceMapFilename: '.tmp/bundle.css.map'
paths: [ 'src/', '.' ]
compress: false
yuicompress: false
dumpLineNumbers: 'comments'
optimization: 0
useminPrepare:
html: 'src/index.html'
options: dest: 'www'
usemin:
html: [ 'www/index.html' ]
options: dirs: ['www']
watch:
grunt: files: [ 'Gruntfile.coffee' ]
less: files: [ 'src/**/*.less' ], tasks: [ 'less','autoprefixer' ]
livereload:
options: livereload: '<%= connect.options.livereload %>'
files: [
'src/index.html'
'src/**/*.{png,gif,jpg,svg}'
'.tmp/bundle.*'
]
grunt.registerTask 'serve', [
'clean'
'browserify:dev'
'less'
'autoprefixer'
'connect:livereload'
'watch'
]
grunt.registerTask 'build', [
'clean'
'browserify:www'
'less'
'autoprefixer'
'copy'
'useminPrepare'
'concat'
'uglify'
'cssmin'
'filerev'
'usemin'
]
# load dinamically as needed grunt plugins
require('jit-grunt')(grunt, {
useminPrepare: 'grunt-usemin'
})
# make stats of time consuming tasks
require('time-grunt')