forked from JavaScriptHub/uvalidator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
97 lines (88 loc) · 2.43 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
/*jslint node: true*/
module.exports = function (grunt) {
"use strict";
grunt.registerTask('md-to-html', 'Build HTML documentation', function () {
var marked = require("color-marked"),
fs = require('fs'),
done = this.async(),
files;
files = grunt.config('md-to-html.files');
marked.setOptions({
gfm: true,
tables: true,
breaks: false,
pedantic: false,
sanitize: true,
smartLists: true
});
files.forEach(function (file) {
fs.readFile(file.src, function (err, data) {
if (err) {
throw err;
}
var html = '<!DOCTYPE html><html><head><title>TITLE</title>' +
'<meta charset="utf-8"></head><body>' +
marked(data.toString('utf8')) +
'</body></html>';
fs.writeFile(file.dest, html, function () {
done();
});
});
});
});
grunt.loadNpmTasks('grunt-jslint');
grunt.loadNpmTasks('grunt-release');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.initConfig({
'md-to-html': {
files: [
{
src: 'README.md',
dest: 'README.html'
}
]
},
jslint: {
src: [
'jquery.uvalidator.js'
]
},
uglify: {
uvalidator: {
files: {
'dist/jquery.uvalidator.min.js': ['jquery.uvalidator.js']
}
},
uvalidatorWRules: {
files: {
'dist/jquery.uvalidator.rules.min.js': [
'jquery.uvalidator.js',
'jquery.uvalidator.rules.js'
]
}
},
uvalidatorWRulesSkinUstreamMessages: {
files: {
'dist/jquery.uvalidator.rules.skin.ustream.messages.min.js': [
'jquery.uvalidator.js',
'jquery.uvalidator.rules.js',
'jquery.uvalidator.skin.js',
'jquery.uvalidator.skin.ustream.js',
'jquery.uvalidator.messages.js'
]
}
},
uvalidatorWRulesSkinUstream: {
files: {
'dist/jquery.uvalidator.rules.skin.ustream.min.js': [
'jquery.uvalidator.js',
'jquery.uvalidator.rules.js',
'jquery.uvalidator.skin.js',
'jquery.uvalidator.skin.ustream.js'
]
}
}
}
});
grunt.registerTask('default', ['md-to-html', 'jslint', 'uglify']);
};