-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
83 lines (80 loc) · 1.45 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
const sass = require('sass');
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
options: {
livereload: true
},
scss: {
files: ['**/*.sass', '**/*.scss'],
tasks: ['sass', 'postcss']
},
pug: {
files: ['**/*.pug'],
tasks: ['pug']
}
},
sass: {
dist: {
options: {
implementation: sass,
outputStyle: 'compressed',
sourceMap: false
},
files: [{
expand: true,
cwd: 'sass/',
src: ['*.sass'],
dest: 'css/',
ext: '.css'
}]
},
blog: {
options: {
implementation: sass,
outputStyle: 'compressed'
},
files: [{
expand: true,
cwd: 'blog/',
src: ['**/*.sass', '**/*.scss'],
dest: 'blog/',
ext: '.css'
}]
}
},
pug: {
compile: {
options: {
pretty: false
},
files: [{
src: ['**/*.pug', '!**/_*.pug'],
dest: "./",
ext: ".html",
cwd: "pug/",
expand: true
}]
}
},
postcss: {
options: {
map: false,
processors: [
require('autoprefixer')
]
},
dist: {
src: ['css/*.css', 'blog/**/*.css']
}
}
});
// Load the Grunt plugins.
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-postcss');
grunt.loadNpmTasks('grunt-contrib-pug');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['watch']);
grunt.registerTask('build', ['sass', 'pug', 'postcss']);
};