-
-
Notifications
You must be signed in to change notification settings - Fork 44
/
Gruntfile.js
53 lines (53 loc) · 1.42 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
module.exports = function(grunt) {
gzip = require("gzip-js");
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
compare_size: {
files: [ "micromarkdown.js", "dist/micromarkdown.min.js" ],
options: {
compress: {
gz: function( contents ) {
return gzip.zip(contents, {}).length;
}
},
cache: "dist/.sizecache.json"
}
},
jshint: {
files: ['./micromarkdown.js'],
options: {
globals: {}
}
},
uglify: {
options: {
banner: '/* * * * * * * * * * * *\n' +
' * micromarkdown .js *\n' +
' * Version <%= pkg.version %> *\n' +
' * License: MIT *\n' +
' * Simon Waldherr *\n' +
' * * * * * * * * * * * */\n\n',
footer: '\n\n/* /micromarkdown */\n'
},
dist: {
files: {
'./dist/micromarkdown.min.js': ['./micromarkdown.js']
}
}
},
compress: {
main: {
options: {
mode: 'gzip'
},
files: [
{expand: true, src: 'dist/micromarkdown.min.js', dest: 'dist/', ext: '.gz.js'}
]
}
}
});
grunt.loadNpmTasks("grunt-compare-size");
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.registerTask('default', ['jshint', 'uglify', 'compare_size']);
};