-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
91 lines (76 loc) · 2.07 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
84
85
86
87
88
89
90
91
/*
* Copyright (c) 2015, Sarbbottam Bandyopadhyay. All rights reserved.
* Copyrights licensed under the MIT License.
* See the accompanying LICENSE file for terms.
*/
'use strict';
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
banner: '/*\n' +
' * Copyright (c) <%= new Date().getFullYear() %>, <%= pkg.author %>. All rights reserved.\n' +
' * Copyrights licensed under the <%= pkg.license %> License.\n' +
' * See the accompanying LICENSE file for terms.\n' +
' */\n',
usebanner: {
taskName: {
options: {
position: 'top',
banner: '<%= banner %>',
linebreak: true || false
},
files: {
src: [ 'dist/css/*.css' ]
}
}
},
clean: ['dist/css/*'],
postcss: {
options: {
processors: [
require('postcss-import')(),
require('postcss-discard-comments'),
require('postcss-custom-properties')(),
require('postcss-inline-svg'),
require('postcss-mixins')(),
require('postcss-nested'),
require('postcss-calc')(),
require('postcss-media-minmax')(),
require('postcss-custom-media')(),
require('autoprefixer')({browsers: 'last 3 version'})
]
},
compile: {
options: {
// ToDo
},
src: 'src/css/main.css',
dest: 'dist/css/ltr.css'
}
},
rtlcss: {
'default': {
dest: 'dist/css/rtl.css',
src: ['dist/css/ltr.css']
}
},
watch: {
css: {
files: ['dist/src/**/*.css'],
tasks: ['clean', 'postcss', 'rtlcss', 'cssmin', 'usebanner']
}
},
cssmin: {
css: {
expand: true,
cwd: 'dist/css/',
src: ['*.css', '!*.min.css'],
dest: 'dist/css/',
ext: '.min.css'
}
}
});
grunt.registerTask('default', ['clean', 'postcss', 'rtlcss', 'cssmin', 'usebanner']);
grunt.registerTask('init', ['watch']);
};