forked from evilstreak/markdown-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
100 lines (92 loc) · 2.28 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
module.exports = function(grunt) {
var pkg = grunt.file.readJSON('package.json');
grunt.initConfig({
pkg: pkg,
env: process.env,
node_tap: {
default_options: {
options: {
outputType: 'failures',
outputTo: 'console'
},
files: {
'tests': ['./test/*.t.js']
}
}
},
jshint: {
files: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'],
options: {
"browser": false,
"maxerr": 100,
"node": true,
"camelcase": false,
"curly": false,
"eqeqeq": true,
"eqnull": true,
"forin": false,
"globals": {
"define": true,
"print": true,
"uneval": true,
"window": true
},
"immed": true,
"indent": 2,
"latedef": true,
"laxbreak": true,
"laxcomma": true,
"lastsemic": true,
"loopfunc": true,
"noarg": true,
"newcap": true,
"plusplus": false,
"quotmark": "true",
"regexp": true,
"shadow": true,
"strict": false,
"sub": true,
"trailing": true,
"undef": true,
"unused": false,
ignores: ['.git', 'node_modules']
}
},
build: {
web: {
dest: "dist/markdown.js",
minimum: ["parser"],
removeWith: ['dialects/gruber'],
startFile: "inc/header.js",
endFile: "inc/footer-web.js"
},
node: {
dest: "lib/markdown.js",
minimum: ["parser"],
removeWith: ['dialects/gruber'],
startFile: "inc/header.js",
endFile: "inc/footer-node.js"
}
},
uglify: {
my_target: {
options: {
compress: true,
mangle: true,
preserveComments: "some",
report: "min"
},
files: {
'dist/markdown.min.js': ['dist/markdown.js']
}
}
}
});
grunt.registerTask('all', ['test', 'build', 'uglify']);
grunt.registerTask('default', ['all']);
grunt.registerTask('test', 'Runs all tests and linting', ['node_tap', 'jshint']);
grunt.loadNpmTasks('grunt-node-tap');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadTasks("inc/tasks");
};