forked from mar10/jquery-ui-contextmenu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
78 lines (73 loc) · 2.24 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
/*jshint node: true */
"use strict";
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
exec: {
tabfix: {
// Cleanup whitespace according to http://contribute.jquery.org/style-guide/js/
// (requires https://github.com/mar10/tabfix)
// cmd: "tabfix -t --line=UNIX -r -m *.js,*.css,*.html,*json,*.yaml -i node_modules ."
cmd: "tabfix -t -r -m *.js,*.css,*.html,*json,*.yaml -i node_modules ."
},
upload: {
// FTP upload the demo files (requires https://github.com/mar10/pyftpsync)
cmd: "pyftpsync --progress upload . ftp://www.wwwendt.de/tech/demo/jquery-contextmenu --delete-unmatched --omit dist,node_modules,.*,_* -x"
}
},
qunit: {
all: ["test/index.html"]
},
jshint: {
files: [
"Gruntfile.js",
"jquery.ui-contextmenu.js",
"test/tests.js"
],
options: {
jshintrc: ".jshintrc"
}
},
uglify: {
options: {
banner: "/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - " +
"<%= grunt.template.today('yyyy-mm-dd') %> | " +
"<%= pkg.homepage ? ' ' + pkg.homepage + ' | ' : '' %>" +
" Copyright (c) <%= grunt.template.today('yyyy') %> <%= pkg.author.name %>;" +
" Licensed <%= _.pluck(pkg.licenses, 'type').join(', ') %> */\n"
},
build: {
src: "jquery.ui-contextmenu.js",
// dest: "build/jquery.ui-contextmenu-<%= pkg.version %>.min.js"
dest: "jquery.ui-contextmenu.min.js"
}
},
connect: {
demo: {
options: {
hostname: "*", // make accessible from everywhere
port: 8080,
base: "./",
keepalive: true
}
}
}
});
grunt.loadNpmTasks("grunt-contrib-connect");
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-contrib-qunit");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-contrib-connect");
grunt.loadNpmTasks("grunt-exec");
grunt.registerTask("server", ["connect:demo"]);
grunt.registerTask("test", ["jshint",
"qunit"]);
grunt.registerTask("travis", ["test"]);
grunt.registerTask("default", ["test"]);
grunt.registerTask("build", ["exec:tabfix",
"test",
"uglify"]);
grunt.registerTask("upload", ["build",
"exec:upload"]);
grunt.registerTask("server", ["connect:demo"]);
};