forked from KolibriDev/form5-grunt-haml-sass-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.coffee
123 lines (101 loc) · 2.94 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
module.exports = (grunt) ->
grunt.initConfig
rubyHaml:
dist:
files: grunt.file.expandMapping(['views/*.haml'], 'dist/',
rename: (base, path) ->
base + path.replace(/\.haml$/, '.html').replace('views/', '')
)
sass:
dist:
files:
'dist/assets/stylesheets/main.css': 'assets/stylesheets/main.scss'
coffeelint:
app:
files:
src: ['assets/javascript/**/*.coffee']
coffee:
options:
sourceMap: true
compile:
files:
'dist/assets/javascript/app.js': ['assets/javascript/**/*.coffee']
imagemin:
all:
files: [
expand: true
cwd: 'assets/images/'
src: ['**/*.{png,jpg,jpeg}']
dest: 'dist/assets/images/'
]
svgmin:
all:
files: [
expand: true
cwd: 'assets/images/'
src: ['**/*.svg']
dest: 'dist/assets/images/'
]
copy:
main:
files: [
{
expand: true
cwd: 'assets/webfonts'
src: '**'
dest: 'dist/assets/webfonts'
}
]
watch:
haml:
files: ['views/**/*.haml']
tasks: ['rubyHaml', 'notify:watch']
coffee:
files: ['assets/javascript/**/*.coffee']
tasks: ['coffeelint', 'coffee', 'notify:watch']
sass:
files: ['assets/stylesheets/**/*.scss']
tasks: ['sass', 'notify:watch']
img:
files: ['assets/images/**/*.{jpg,png,jpeg}']
tasks: ['imagemin', 'notify:watch']
webfonts:
files: ['assets/webfonts/**']
tasks: ['copy', 'notify:watch']
dist:
files: ['dist/assets/stylesheets/**/*.css', 'dist/**/*.html', 'dist/assets/images/**/*', 'dist/assets/javascript/**/*.js']
options:
livereload: true
connect:
server:
options:
port: 1337
base: 'dist'
open:
dev:
path: 'http://localhost:1337/'
app: 'Google Chrome'
notify_hooks:
enabled: true
notify:
watch:
options:
title: 'Task complete'
message: 'Dist files successfully updated'
server:
options:
title: 'Server started'
message: 'Server started at http://localhost:1337'
grunt.loadNpmTasks 'grunt-notify'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-ruby-haml'
grunt.loadNpmTasks 'grunt-sass'
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-contrib-imagemin'
grunt.loadNpmTasks 'grunt-contrib-connect'
grunt.loadNpmTasks 'grunt-open'
grunt.loadNpmTasks 'grunt-svgmin'
grunt.loadNpmTasks 'grunt-contrib-copy'
grunt.loadNpmTasks 'grunt-coffeelint'
grunt.registerTask 'default', ['rubyHaml', 'sass', 'imagemin', 'svgmin', 'coffeelint', 'coffee', 'copy']
grunt.registerTask 'server', ['default', 'connect', 'notify:server', 'open:dev', 'watch']