-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.js
More file actions
74 lines (69 loc) · 2 KB
/
Gruntfile.js
File metadata and controls
74 lines (69 loc) · 2 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
'use strict';
module.exports = function (grunt) {
// load all grunt tasks
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.initConfig({
watch: {
// if any .less file changes in directory "public/css/" run the "less"-task.
files: "assets/css/*.less",
tasks: ["less:dev"]
},
// "less"-task configuration
less: {
dev: {
options: {
paths: ["assets/css/"],
},
files: {
// compilation.css : source.less
"assets/css/style.css": "assets/css/style.less"
}
},
dist: {
options: {
compress: true,
yuicompress: true,
optimization: 2,
},
files: {
"assets/css/style.min.css": "assets/css/style.less"
}
}
},
// "autoprefixer"-task configuration
autoprefixer: {
options: {
browsers: [
"Android 2.3",
"Android >= 4",
"Chrome >= 20",
"Firefox >= 24",
"Explorer >= 8",
"iOS >= 6",
"Opera >= 12",
"Safari >= 6"
]
},
style: {
options: {
map: true
},
src: "assets/css/style.min.css"
},
},
});
// Load NPM tasks
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-autoprefixer');
// Deaful task (running "grunt" in console) is "watch"
grunt.registerTask('default', [
'watch'
]);
// Dist task
grunt.registerTask('dist', [
'less:dist',
'autoprefixer'
]);
};