-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
111 lines (102 loc) · 2.64 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
module.exports = function (grunt) {
'use strict';
require('load-grunt-tasks')(grunt);
var config = {
title: "Islay Theme for Ghost",
pkg: grunt.file.readJSON('./package.json'),
clean: {
css: ['assets/css/*'],
js: ['assets/js/*.min.js', '!assets/js/*.js', '!assets/js/vendor','!assets/js/foundation']
},
sass: {
debug: {
options: {
sourcemap: true,
debugInfo: true,
style: 'nested',
noCache: true,
quiet: true
},
files : {
'assets/css/styles.min.css': 'assets/scss/styles.scss',
'assets/css/styles.css': 'assets/scss/styles.scss'
}
},
dist: {
options: {
style: 'compressed',
noCache: true,
quiet: true
},
files: {
'assets/css/styles.min.css': 'assets/scss/styles.scss'
}
}
},
concat: {
options: {
separator: ';'
},
dist: {
src: [
'assets/js/foundation/foundation.js',
'assets/js/foundation/foundation.offcanvas.js',
'assets/js/foundation/foundation.reveal.js',
'assets/js/foundation/foundation.topbar.js'
],
dest: 'assets/js/foundation.js'
}
},
uglify: {
options: {
preserveComments: false
},
debug: {
files: {
'assets/js/foundation.min.js': ['<%= concat.dist.dest %>']
}
},
dist: {
files: {
'assets/js/foundation.min.js': ['<%= concat.dist.dest %>'],
'assets/js/index.min.js': ['assets/js/index.js']
}
}
},
copy: {
debug: {
files: [{
src: [
'assets/js/index.js'
],
dest: 'assets/js/index.min.js'
}]
}
},
autoprefixer: {
options: {
browsers: ['last 2 versions']
},
dist: {
files: {
'assets/css/styles.min.css': 'assets/css/styles.min.css'
}
}
},
watch: {
css: {
files: ['assets/scss/**/*','assets/scss/*'],
tasks: ['css:debug']
},
js: {
files: ['assets/js/*'],
tasks: ['js:debug']
}
}
};
grunt.registerTask('js:debug', ['clean:js', 'concat', 'uglify:debug', 'copy:debug']);
grunt.registerTask('css:debug', ['clean:css', 'sass:debug']);
grunt.registerTask('debug', ['css:debug', 'js:debug']);
grunt.registerTask('default', ['clean', 'sass:dist', 'uglify:dist', 'autoprefixer']);
grunt.initConfig(config);
}