-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
113 lines (91 loc) · 2.15 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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
options: {
livereload: true,
},
configFiles: {
files: [ 'Gruntfile.js', 'config/*.js' ],
options: {
reload: true
}
},
compass: {
files: ['scss/**/*.{scss,sass}'],
tasks: ['compass:dev', 'autoprefixer'],
options: {
spawn: false,
}
},
html: {
files: ['**/*.html'],
options: {
spawn: false,
}
},
scripts: {
files: ['js/*.js'],
tasks: ['uglify'],
options: {
spawn: false,
},
}
},
uglify: {
build: {
src: ['js/main.js', 'js/plugins.js'], //input
dest: 'build/js/main.min.js' //output
}
},
imagemin: {
dynamic: {
files: [{
expand: true,
cwd: 'img/',
src: ['**/*.{png,jpg,gif}'],
dest: 'build/img/'
}]
}
},
autoprefixer: {
options: {
browsers: ['last 8 versions']
},
dist: {
files: {
'build/css/styles.css' : 'build/css/styles.css'
}
}
},
compass: {
dev: {
options: {
sassDir: ['scss/'],
cssDir: ['build/css'],
environment: 'development'
}
},
prod: {
options: {
sassDir: ['scss/'],
cssDir: ['build/css'],
environment: 'production'
}
},
},
production: {
tasks:['compass:prod']
},
});
// Load the plugin that provides the task.
grunt.loadNpmTasks('grunt-autoprefixer');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-imagemin');
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-livereload');
// Default task(s).
grunt.registerTask('default', ['livereload', 'autoprefixer', 'uglify', 'imagemin', 'compass']);
};