-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
119 lines (119 loc) · 3.58 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
107
108
109
110
111
112
113
114
115
116
117
118
119
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
copy: {
dev: {
files: [
// copy javascripts
{
expand: true,
cwd: 'src',
src: ['js/**'],
dest: 'static/'
},
// copy images
{
expand: true,
cwd: 'src',
src: ['img/**'],
dest: 'static/'
},
// copy fonts
{
expand: true,
cwd: 'src',
src: ['fonts/**'],
dest: 'static/'
},
{
expand: true,
cwd: 'node_modules/jquery/dist',
src: ['jquery.js'],
dest: 'static/js/vendor'
}
]
}
},
watch: {
// compass, sass compilation
compass: {
files: ['src/sass/*.scss', 'src/sass/partials/*.scss', 'src/sass/vendor/*.scss'],
tasks: ['compass:dev']
},
// enable LiveReload for css files
css: {
files: ['static/css/*.css'],
options: {
livereload: 9000
}
},
// enable LiveReload for html files
html: {
files: ['*.html'],
options: {
livereload: 9000
}
},
// enable JS copy
copy: {
files: ['src/js/*.js', 'src/img/**'],
tasks: ['copy:dev']
}
},
compass: {
dev: {
options: {
config: 'config.rb',
sourcemap: true
}
},
compile: {
options: {
config: 'config.rb'
}
}
},
uglify: {
all: {
files: {
'static/js/app.min.js': [
'node_modules/jquery/dist/jquery.js',
'src/js/plugins.js',
'src/js/main.js'
]
}
}
},
connect: {
server: {
options: {
port: grunt.option('port') || 8080,
hostname: 'localhost',
base: ''
}
}
},
kraken: {
options: {
key: '392a6ec2e40984badb17c88f11d20c25',
secret: '00167e53c8d24068e73149c941afa866cb6eb48d',
lossy: true
},
dynamic: {
files: [{
expand: true,
cwd: 'static/img/',
src: ['**/*.{png,jpg,jpeg,gif}'],
dest: 'static/img/'
}]
}
}
});
// Load the plugin
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
// Default task(s).
grunt.registerTask('default', ['compass:dev', 'connect:server', 'copy:dev', 'watch']);
// SASSS/Compass compilation only
grunt.registerTask('compile', ['compass:compile', 'copy:dev']);
grunt.registerTask('krak', ['kraken']);
};