-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathGruntFile.js
98 lines (95 loc) · 2.33 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
87
88
89
90
91
92
93
94
95
96
97
98
module.exports = function(grunt) {
//Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
mocha: {
all: {
src: ["test/unit/index.html"]
},
options: {
run: true
}
},
connect: {
server: {
options: {
port: 8080,
protocol: "http",
hostname: "127.0.0.1",
base: ".",
livereload: true
}
}
},
requirejs: {
compile: {
options: {
baseUrl: ".",
mainConfigFile: "src/require.config.js",
name: "node_modules/almond/almond",
include: ["src/require.config", "jubilee"],
optimize: "none",
out: "build/jubilee.js",
wrap: {
startFile: "src/start.js",
endFile: "src/end.js"
}
}
}
},
uglify: {
options: {
banner: "/*! <%= pkg.name %> - v<%= pkg.version %> - " +
"<%= grunt.template.today('yyyy-mm-dd') %> */"
},
js: {
files: {
"build/jubilee.min.js": ["build/jubilee.js"]
}
}
},
jshint: {
foo: {
src: "src/**/*.js"
},
options: {
jshintrc: ".jshintrc"
}
},
watch: {
js: {
files: ["src/**/*.js"],
tasks: []
}
},
copy: {
css: {
files: [
{ src: "src/style/jubilee.css", dest: "build/jubilee.css" }
]
}
},
cssmin: {
dist: {
files: {
"build/jubilee.min.css" : ["build/jubilee.css"]
}
}
}
});
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-contrib-copy");
grunt.loadNpmTasks("grunt-contrib-cssmin");
grunt.loadNpmTasks("grunt-contrib-requirejs");
grunt.loadNpmTasks("grunt-contrib-connect");
grunt.loadNpmTasks("grunt-mocha");
grunt.registerTask("default", ["requirejs", "copy", "connect", "watch"]);
grunt.registerTask("production", ["requirejs", "uglify", "copy", "cssmin"]);
grunt.registerTask("release", ["production"]);
grunt.registerTask("lint", ["jshint"]);
grunt.registerTask("test", ["mocha"]);
grunt.registerTask("build", ["requirejs", "copy"]);
};