-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.js
More file actions
99 lines (84 loc) · 2.69 KB
/
Copy pathGruntfile.js
File metadata and controls
99 lines (84 loc) · 2.69 KB
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
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// grunt-contrib-imagemin - compresses images
// https://github.com/gruntjs/grunt-contrib-imagemin
imagemin: {
dynamic: {
files: [{
expand: true,
cwd: 'images/images-src',
src: ['*.{png,jpg,gif}'],
dest: 'images/'
}]
}
},
// grunt-contrib-sass - complies sass
// https://github.com/gruntjs/grunt-contrib-sass
sass: {
dist: {
options: {
style: 'compressed'
},
files: {
'css/styles.css': 'css/styles.scss'
}
}
},
// grunt-contrib-uglify - minifies js
// https://github.com/gruntjs/grunt-contrib-uglify
uglify: {
dist: {
options: {
compress: false,
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' + '<%= grunt.template.today("yyyy-mm-dd h:MM:ss") %> */',
mangle: false
},
files: {
'js/scripts.min.js': [
'js/libs/jquery-1.11.0.min.js',
'js/scripts/_portfolio.js'
],
}
}
},
// grunt-contrib-watch - watches for changes. Includes live reload
// https://github.com/gruntjs/grunt-contrib-watch
watch: {
css: {
files: ['css/styles.css'],
options: {
livereload: true
}
},
sass: {
files: ['css/sass/*.scss',
'css/sass/components/*.scss',
'css/sass/elements/*.scss',
'css/sass/mixins/*.scss'],
tasks: ['sass'],
options: {
spawn: false
}
},
images: {
files: ['images/images-src/*.*'],
tasks: ['imagemin'],
options: {
spawn: false
}
},
scripts: {
files: ['js/scripts/_*.js'],
tasks: ['uglify'],
options: {
spawn: false
}
}
}
});
require('load-grunt-tasks')(grunt);
grunt.registerTask('default', ['imagemin', 'sass', 'uglify']);
grunt.registerTask('dev', ['watch']);
};