-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
54 lines (54 loc) · 1.32 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
module.exports = function (grunt) {
"use strict";
// Initialize the config
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
// Base path
src: 'src',
dest: 'dest',
// Grunt-sass
sass: {
options: {
sourceMap: true
},
dist: {
files: {
"<%= dest %>/css/style.css": "<%= src %>/sass/*.scss"
}
}
},
// Combined Media Queries
cmq: {
options: {
log: false
},
your_target: {
files: {
"<%= dest %>/css/combined": ["<%= dest %>/css/style.css"]
}
}
},
// Minify css
cssmin: {
target: {
files: {
"<%= dest %>/css/style.min.css": ["<%= dest %>/css/combined/*.css"]
}
}
},
// Grunt-contrib-watch
watch: {
sass: {
// Watches all Sass or Scss files recursive within the sass folder
files: ["<%= src %>/sass/**/*.scss"],
// runs the task `sass` and cssmin whenever any watched file changes
tasks: ["sass", "cmq", "cssmin:target"]
}
},
});
grunt.loadNpmTasks("grunt-sass");
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks("grunt-combine-media-queries");
grunt.loadNpmTasks("grunt-contrib-cssmin");
grunt.registerTask("default", ["sass", "cmq", "cssmin", "watch"]);
};