-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathGruntfile.js
98 lines (82 loc) · 1.97 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
92
93
94
95
96
97
98
/*
* grunt-css-purge
* https://github.com/dominikwilkowski/grunt-css-purge
*
* Copyright (c) 2018 Dominik Wilkowski
* Licensed under the GNU GPL2 license.
*/
'use strict';
module.exports = function( grunt ) {
require( 'load-grunt-tasks' )( grunt );
grunt.initConfig({
clean: {
tests: ['test/temp'],
},
css_purge: {
// Default options in src / dest notation
default_options: {
options: {},
src: 'test/css/test.css',
dest: 'test/temp/default_options.css',
},
// Default options with multiple files in src / dest notation
multiple_files: {
options: {},
src: [
'test/css/test.css',
'test/css/subfolder/test2.css',
],
dest: 'test/temp/multiple_files.css',
},
// Default options with multiple files in files notation
multiple_files2: {
options: {},
files: {
'test/temp/multiple_files2.css': ['test/css/test.css', 'test/css/subfolder/test2.css'],
},
},
// Default options with multiple files with wildcard in files notation
multiple_files3: {
options: {},
files: [{
src: ['test/css/**/*.css'],
dest: 'test/temp/multiple_files3.css',
}],
},
// Default options with multiple files converting to multiple files
multiple_files4: {
options: {},
files: [{
expand: true,
cwd: "test/css/",
src: "*.css",
dest: "test/temp/",
ext: ".min.css",
}],
},
// Default options with multiple files converting to multiple files in wildcard folder
multiple_files5: {
options: {},
files: [{
expand: true,
cwd: "test/css/",
src: "**/*.css",
dest: "test/temp/",
ext: ".min.css",
}],
},
// Custom options
custom_options: {
options: {
trim_comments: false,
shorten: false,
},
src: 'test/css/test.css',
dest: 'test/temp/default_options.css',
},
},
});
grunt.loadTasks('tasks');
grunt.registerTask('test', ['clean', 'css_purge']);
grunt.registerTask('default', ['test']);
};