This repository has been archived by the owner on Oct 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
gruntfile.js
77 lines (68 loc) · 1.8 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
module.exports = (grunt, isTest) => {
'use strict'
// Track execution time
// Execute only when we are _not_ in test environment, otherwise tests will never exit
if (!isTest) require('time-grunt')(grunt)
// Load grunt tasks automatically
require('jit-grunt')(grunt)
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
path: {
temp: 'temp',
test: 'tests',
fixtures: '<%= path.test %>/fixtures',
defaultOptionsMap: '<%= path.temp %>/sitemap.xml',
customOptionsMap: '<%= path.temp %>/custommap.xml',
noTrailingSlashMap: '<%= path.temp %>/notrailingslash.xml'
},
clean: {
test:
'<%= path.temp %>'
},
sitemap_xml: {
default_options: {
options: {
lastMod: new Date('2017-09-28').toISOString()
},
files: [{
cwd: '<%= path.fixtures %>',
src: '{,**/}*.html',
dest: '<%= path.defaultOptionsMap %>'
}]
},
custom_options: {
options: {
siteRoot: 'true',
stripIndex: false,
lastMod: new Date('2017-09-28').toISOString(),
priority: '0.1',
changeFreq: 'monthly',
pretty: true
},
files: [{
cwd: '<%= path.fixtures %>',
src: '{,**/}*.{html,htm}',
dest: '<%= path.customOptionsMap %>'
}]
},
no_trailing_slash: {
options: {
lastMod: new Date('2017-09-28').toISOString(),
trailingSlash: false,
pretty: true
},
files: [{
cwd: '<%= path.fixtures %>',
src: '{,**/}*.html',
dest: '<%= path.noTrailingSlashMap %>'
}]
}
}
})
grunt.loadTasks('tasks')
grunt.registerTask('test', [
'clean',
'sitemap_xml'
])
return grunt
}