-
Notifications
You must be signed in to change notification settings - Fork 9
/
Gruntfile.coffee
146 lines (131 loc) · 3.2 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
'use strict'
path = require('path')
lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet
folderMount = (connect, point) ->
return connect.static(path.resolve(point))
module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON('package.json')
uglify:
options:
mangle: false
preserveComments: 'some'
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> */'
compile:
files:
'js/script.min.js' : [
#'src/js/plugins/jrespond.js',
'src/js/bootstrap/bootstrap-dropdown.js',
'src/js/plugins/plugins.js',
'src/js/script.js']
'js/script-touch.min.js' : [
#'src/js/plugins/fastclick.js',
#'src/js/plugins/jrespond.js',
'src/js/plugins/touchswipe.js',
'src/js/bootstrap/bootstrap-dropdown.js',
'src/js/plugins/plugins.js',
'src/js/script.js',
'src/js/touch.js']
'js/slider.min.js' : [
'src/js/plugins/anythingslider.js'
#'src/js/plugins/jquery.flexslider-min.js',
#'src/js/plugins/bjqs.min.js',
'src/js/slider-update.js']
compile_no_uglify:
options:
compress: false
mangle: false
preserveComments: 'all'
beautify: true
banner: ''
files:
'js/init.js' : 'src/js/init.js'
'js/modernizr.js' : [
'src/js/plugins/modernizr.js',
'src/js/plugins/modernizr-boxsizing.js']
jshint:
options:
"camelcase" : false
"es3" : false
"trailing" : false
"white" : false
"smarttabs" : true
"jquery" : true
"browser" : true
files:[
'src/js/fonts.js',
'src/js/init.js',
'src/js/script.js',
'src/js/slider-update.js',
'src/js/touch.js'
]
sass:
options:
style: 'compact'
compass: 'config.rb'
#debugInfo: true
trace: true
loadPath: ['src/sass/','src/sass/shared/']
compile:
files:[
expand: true
cwd: 'src/sass/'
src: ['*.scss', '*.sass']
dest: 'css/'
ext: '.css'
]
autoprefixer:
options:
map: true
browsers: ['last 4 versions', '> 1%']
files:
src: 'css/*.css'
jade:
options:
pretty: true
compile:
files:[
expand: true
cwd: 'src/jade/'
src: ['**/*.html.jade']
dest: ''
ext: '.html'
]
newer:
options:
override: (detail, include) ->
if detail.task is 'sass' or detail.task is 'jade'
include true
# checkForModifiedImports grunt, detail.path, detail.time, include
else
include false
connect:
server:
options:
port: 9001
livereload: 9002
watch:
options:
spawn: false
sass:
files: ['src/sass/**/*.sass', 'src/sass/**/*.scss']
tasks: ['newer:sass']
css:
options:
livereload: true
files: ['css/**/*']
tasks: ['newer:autoprefixer']
jade:
files: ['src/jade/**/*.jade']
tasks: ['newer:jade']
js:
files: ['src/js/script.js', 'src/js/touch.js']
tasks: ['newer:jshint', 'newer:uglify']
livereload:
files: ['img/*', '*.html', 'js/*.min.js']
options:
livereload: true
require('load-grunt-tasks')(grunt);
# Default task(s).
grunt.registerTask('compile', ['sass', 'autoprefixer', 'jade', 'jshint', 'uglify'])
grunt.registerTask('default', ['connect', 'watch'])