This repository has been archived by the owner on Dec 20, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathGruntfile.js
122 lines (111 loc) · 3.17 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
jshint: {
options: {
jshintrc: '.jshintrc'
},
all: [
'Gruntfile.js',
'tasks/*.js',
'test/*/*.js'
]
},
version: {
assets: {
// Files Array Format
files: {
'test/fixtures/script2.php': ['test/fixtures/assets/css/main.min.css', 'test/fixtures/assets/js/scripts.min.js']
}
},
roots: {
options: {
summaryOnly: true,
length: 8,
manifest: 'test/fixtures/assets/assets-manifest.json',
},
files: {
'test/fixtures/script3.php': ['test/fixtures/assets/css/main.min.css', 'test/fixtures/assets/js/scripts.min.js']
}
},
rootsQuerystring: {
options: {
summaryOnly: true,
format: true,
length: 32,
manifest: 'test/fixtures/assets/assets-manifest-querystring.json',
querystring: {
style: 'roots_css',
script: 'roots_js'
}
},
files: {
'test/fixtures/script3.php': ['test/fixtures/assets/css/main.min.css', 'test/fixtures/assets/js/scripts.min.js']
}
},
withConfig: {
options: {
format: true,
algorithm: 'sha1',
length: 8,
manifest: 'test/fixtures/assets/manifest_withConfig.json',
},
// Compact Format
src: ['test/fixtures/assets/css/main.min.css','test/fixtures/assets/css/custom.min.css',
'test/fixtures/assets/js/scripts.min.js'],
dest: 'test/fixtures/index.html'
},
// Legacy Roots filename revving.
querystring: {
options: {
format: true,
length: 32,
manifest: 'test/fixtures/assets/manifest.json',
querystring: {
style: 'roots_css',
script: 'roots_js'
}
},
files: {
'test/fixtures/lib/scripts2.php': 'test/fixtures/assets/{css,js}/{main,scripts}.min.{css,js}'
}
},
rootsWithoutQuerystring: {
options: {
format: true,
length: 8
},
files: {
'test/fixtures/lib/scripts.php': ['test/fixtures/assets/css/main.min.css', 'test/fixtures/assets/js/scripts.min.js']
}
},
withoutFormat2times: {
options: {
length: 8,
algorithm: 'sha1'
},
files: {
'test/fixtures/lib/scripts3.php': ['test/fixtures/assets/css/main.min.css', 'test/fixtures/assets/js/scripts.min.js']
}
}
},
simplemocha: {
options: {
reporter: 'spec'
},
test: {
src: 'test/*.js'
}
},
clean: {
tests: ['test/fixtures/assets/{css,js}/*.{css,js}', 'test/fixtures/assets/*.json', '!test/fixtures/assets/{css,js}/{main,scripts,custom}.min.{css,js}']
},
});
// Load tasks
grunt.loadTasks('tasks');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-simple-mocha');
grunt.loadNpmTasks('grunt-contrib-jshint');
// Register tasks
grunt.registerTask('default', [ 'jshint', 'clean', 'version', 'simplemocha']);
};