-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathGruntfile.js
55 lines (48 loc) · 1.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
'use strict';
module.exports = function (grunt) {
// Load any grunt plugins found in package.json.
require('load-grunt-tasks')(grunt);
require('time-grunt')(grunt);
grunt.initConfig({
linkChecker: {
all: {
site: 'localhost',
options: {
initialPort: 9001
}
},
redirect: {
site: 'localhost',
options: {
force: true,
checkRedirect: true,
initialPort: 9001
}
}
},
jshint: {
options: {
jshintrc: true
},
files: {
src: ['Gruntfile.js', 'tasks/*.js']
}
},
connect: {
server: {
options: {
base: 'test/fixtures',
port: '<%= linkChecker.all.options.initialPort %>',
middleware: function(connect, options, middlewares) {
var modRewrite = require('connect-modrewrite');
middlewares.unshift(modRewrite(['^/index3.html$ /index2.html [R=301,L]']));
return middlewares;
}
}
}
}
});
grunt.registerTask('default', 'test');
grunt.registerTask('test', ['jshint', 'connect', 'linkChecker']);
grunt.loadTasks('tasks');
};