forked from tbranyen/backbone-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
106 lines (97 loc) · 2.38 KB
/
Gruntfile.js
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
module.exports = function(grunt) {
// Configuration
// =======================================
grunt.initConfig({
// Server
connect: {
server: {
options: {
port: 8989
}
}
},
// Watch
watch: {
options: { livereload: true },
files: [
'vendor/**/*',
'app/styles/**/*.scss',
'app/styles/**/*.sass',
'app/styles/modules/*.sass',
'app/templates/**/*.jade',
'app/*.js',
'app/modules/**/*.js',
'data/**/*',
'source/icons/*',
'!app/styles/exts/_icons.scss'
],
tasks: ['sass', 'jade', 'fontcustom']
},
// Compile SASS/SCSS
// Since all other stylesheets are @import-ed in index.scss,
// that's the only one we need to compile.
sass: {
app: {
files: {
'app/styles/index.css': 'app/styles/index.sass'
}
}
},
// Compile Jade templates
jade: {
compile: {
options: {
pretty: true,
client: true,
amd: true,
compileDebug: false
},
files: {
'app/templates/templates.js': ['app/templates/**/*.jade']
}
}
},
// Font Custom
shell: {
fontcustom: {
command: 'fontcustom compile source/icons'
}
},
copy: {
fontcustom: {
files: [
{src: ['source/icons/fontcustom/*.woff'], dest: 'app/styles/fonts/icons.woff'},
{src: ['source/icons/fontcustom/*.eot'], dest: 'app/styles/fonts/icons.eot'},
{src: ['source/icons/fontcustom/*.svg'], dest: 'app/styles/fonts/icons.svg'},
{src: ['source/icons/fontcustom/*.ttf'], dest: 'app/styles/fonts/icons.ttf'}
]
}
},
replace: {
fontcustom: {
src: ['source/icons/fontcustom/fontcustom.css'],
dest: ['app/styles/exts/_icons.scss'],
replacements: [{
from: /fontcustom_[^.]+/g,
to: 'fonts/icons'
}, {
from: 'fontcustom',
to: 'icons'
}]
}
}
});
// Define grunt tasks
// =======================================
grunt.registerTask('default', ['connect', 'watch']);
grunt.registerTask('fontcustom', ['shell:fontcustom', 'copy:fontcustom', 'replace:fontcustom']);
// Load grunt packages
// =======================================
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-jade');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-text-replace');
grunt.loadNpmTasks('grunt-shell');
};