-
Notifications
You must be signed in to change notification settings - Fork 20
/
Gruntfile.js
59 lines (55 loc) · 1.99 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
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
jshint: {
options: { jshintrc: true },
code: ["js/**/*.js"],
tests: ["test/**/*.js"]
},
qunit: {
all: ["test/**/unit-tests.html"]
},
clean: {
src: ["dist/css/", "dist/js/", "dist/img/", ".site/passfield"]
},
uglify: {
options: {
banner: "/*! <%= pkg.name %> v<%= pkg.version %> | (c) <%= grunt.template.today('yyyy') %> Antelle | https://github.com/antelle/passfield/blob/master/MIT-LICENSE.txt */\n"
},
passfield: {
files: {
"dist/js/passfield.min.js": ["js/*.js"]
}
}
},
cssmin: {
compress: {
files: {
"dist/css/passfield.min.css": ["css/*.css"]
}
}
},
copy: {
img: {
files: [
{ expand: true, src: ["img/*.jpg", "img/*.png"], dest: "dist/" }
]
},
site: {
files: [
{ expand: true, flatten: true, src: ["dist/img/*.jpg", "dist/img/*.png"], dest: ".site/passfield/img/" },
{ expand: true, flatten: true, src: "dist/js/*.js", dest: ".site/passfield/js/" },
{ expand: true, flatten: true, src: "dist/css/*.css", dest: ".site/passfield/css/" }
]
}
}
});
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-contrib-qunit");
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks("grunt-contrib-copy");
grunt.registerTask("default", ["jshint", "qunit", "clean", "uglify", "cssmin", "copy"]);
};