forked from ryanlfoster/vanilla-modal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgruntfile.js
67 lines (56 loc) · 1.47 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
module.exports = function(grunt) {
"use strict";
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-6to5');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
"jshint" : {
options: {
esnext : true,
browser : true,
globals : {
define : true,
module : true
},
},
files: {
src: ['src/vanilla-modal.js']
}
},
"6to5" : {
options : {
sourceMap: true
},
dist : {
files : {
"dist/vanilla-modal.js" : "src/vanilla-modal.js"
}
}
},
"uglify" : {
target : {
options : {
banner: '/**\n * @name <%= pkg.name %>\n * @version <%= pkg.version %>\n * @author Ben Ceglowski\n * @url http://phuse.ca\n * @date <%= grunt.template.today("yyyy-mm-dd") %>\n * @license MIT\n */;',
report : 'gzip'
},
files : {
"dist/vanilla-modal.min.js" : ["dist/vanilla-modal.js"]
}
}
},
"watch" : {
scripts: {
files: ["src/vanilla-modal.js"],
tasks: ["build"],
options: {
spawn: false,
}
}
}
});
grunt.registerTask("default", ["6to5", "uglify", "watch"]);
grunt.registerTask("build", ["jshint", "6to5", "uglify"]);
grunt.registerTask("minify", ["uglify"]);
};