-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
58 lines (55 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
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
watch: {
scripts: {
files: ["./javascripts/**/*.js", "!node_modules/**/*.js", "!bower_components/**/*.js"],
tasks: ["concat:squash", "uglify"],
options: {
spawn: false,
}
}
},
uglify: {
options: {
banner: "/*! <%= pkg.name %> <%= grunt.template.today('yyyy-mm-dd') %> */\n",
sourceMap: true,
sourceMapIncludeSources: true,
sourceMapIn: '.tmp/main.js.map'
},
build: {
files: [{
expand: true,
cwd: ".tmp",
src: "main.js",
dest: "build",
ext: ".min.js"
}]
}
},
concat: {
options: {
sourceMap: true
},
squash: {
src: [
'javascripts/util.js', 'javascripts/Gauntlet.js', 'javascripts/player.js',
'javascripts/weapons.js', 'javascripts/battleground.js', 'javascripts/classes.js',
'javascripts/horde.js', 'javascripts/spells.js', 'javascripts/app.js',
'javascripts/templates.js'
],
dest: '.tmp/main.js'
}
}
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks("grunt-contrib-uglify-es");
// Load the plugin that provides the "watch" task.
grunt.loadNpmTasks("grunt-contrib-watch");
// Load the plugin that provides the "concat" task.
grunt.loadNpmTasks("grunt-contrib-concat");
// Default task(s).
grunt.registerTask("default", ["concat:squash", "uglify", "watch"]);
grunt.registerTask("build", ["concat:squash", "uglify"]);
};