-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
66 lines (57 loc) · 1.66 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
module.exports = function (grunt)
{
'use strict';
// Load all Grunt tasks.
require('load-grunt-tasks')(grunt);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// Set up paths.
paths: {
src: {
sass: 'src/sass/'
},
dest: {
css: 'dist/css/'
}
},
// Clean distribution directories/files to start afresh.
clean: [
'<%= paths.dest.css %>'
],
// Add vendor prefixed styles and other post-processing transformations.
postcss: {
options: {
processors: [
require('autoprefixer'),
require('cssnano')
]
},
dist: {
src: '<%= paths.dest.css %>*.css'
}
},
// Sass configuration.
sass: {
options: {
implementation: require('sass'),
outputStyle: 'expanded', // outputStyle = expanded, nested, compact or compressed.
sourceMap: false
},
dist: {
files: [
{'<%= paths.dest.css %>style.css': '<%= paths.src.sass %>style.scss'}
]
}
},
// Directories watched and tasks performed by invoking `grunt watch`.
watch: {
sass: {
files: '<%= paths.src.sass %>**/*.scss',
tasks: 'build'
}
}
});
// Register tasks.
grunt.registerTask('build', ['clean', 'sass', 'postcss']);
grunt.registerTask('default', ['watch']);
};