-
Notifications
You must be signed in to change notification settings - Fork 12
/
Gruntfile.js
62 lines (50 loc) · 1.18 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
module.exports = function (grunt) {
/** @var {Grunt} grunt */
'use strict';
// Force use of Unix newlines
grunt.util.linefeed = '\n';
RegExp.quote = function (string) {
return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&');
};
var fs = require('fs');
var path = require('path');
// Project configuration.
grunt.initConfig({
// Metadata.
pkg: grunt.file.readJSON('package.json'),
banner: '/*!\n' +
' * ForkdIn v<%= pkg.version %> (<%= pkg.homepage %>)\n' +
' */\n',
// Task configuration.
clean: {
dist: 'css'
},
sass: {
options: {
includePaths: ['scss'],
precision: 6,
sourceComments: false,
sourceMap: true,
outputStyle: 'expanded'
},
core: {
files: {
'css/<%= pkg.name %>.css': 'scss/styles.scss'
}
}
},
watch: {
sass: {
files: 'scss/**/*.scss',
tasks: ['dist-css']
}
}
});
// These plugins provide necessary tasks.
require('load-grunt-tasks')(grunt);
grunt.registerTask('sass-compile', ['sass:core']);
grunt.registerTask('dist-css', ['sass-compile']);
// Full distribution task.
grunt.registerTask('build', ['clean:dist', 'dist-css']);
grunt.registerTask('default', ['build', 'watch']);
};