-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathGruntfile.js
86 lines (84 loc) · 1.97 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
module.exports = function(grunt) {
"use strict";
// Project configuration.
var jsFiles = ["./Gruntfile.js", "src/**/*.js"];
var jsbeautifierconfigObject = grunt.file.readJSON("jsbeautifier.json");
var sourceJsFiles = [
"src/headerNotice.md",
"src/choona.Klass.js",
"src/choona.Base.js",
"src/choona.uniqueIdManager.js",
"src/choona.Settings.js",
"src/choona.Util.js",
"src/choona.EventBus.js",
"src/choona.DomEvents.js",
"src/choona.Model.js",
"src/choona.View.js",
"src/choona.Router.js",
"src/choona.AMD.js"
];
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
uglify: {
build: {
"src": "dist/choona.js",
"dest": "dist/choona.min.js"
}
},
clean: {
all: {
src: ["dist/*"]
}
},
docco: {
debug: {
src: jsFiles,
options: {
output: "docs/"
}
}
},
watch: {
js: {
files: sourceJsFiles,
tasks: ["build"]
},
js1: {
files: ["dist/choona.js"],
options: {
livereload: true
}
}
},
concat: {
options: {
separator: ";"
},
js: {
src: sourceJsFiles,
dest: "dist/choona.js"
}
},
jshint: {
all: jsFiles,
options: {
jshintrc: ".jshintrc",
jshintignore: ".jshintignore"
}
},
jsbeautifier: {
files: jsFiles,
options: jsbeautifierconfigObject
}
});
grunt.loadNpmTasks("grunt-docco");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-jsbeautifier");
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.registerTask("build", ["check", "clean", "concat", "uglify:build"]);
grunt.registerTask("check", ["jsbeautifier", "jshint"]);
grunt.registerTask("default", ["build"]);
};