-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
43 lines (39 loc) · 1.18 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
module.exports = function(grunt) {
var path = 'public/js/src/';
var files = ['preLoad.js', 'blockingTerrain.js', 'generalUtilities.js', 'drawingUtilities.js', 'entityUtilities.js', 'castles.js',
'entityInfo.js', 'globals.js', 'mapPointUtilities.js',
'controlFunctions.js', 'drawMap.js', 'drawEntities.js', 'bindButtons.js', 'entities.js',
'hammerSetup.js', 'setUpSocketListeners.js', 'playerControls.js', 'main.js'];
for(var i = 0; i < files.length; i++){
files[i] = path + files[i];
}
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
mangle: true,
compress: {
sequences: true,
dead_code: true,
conditionals: true,
booleans: true,
unused: true,
if_return: true,
join_vars: true,
drop_console: true
}
},
my_target: {
files: {
'public/js/build/game.min.js': files
}
}
}
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');
// Default task(s).
grunt.registerTask('default', ['uglify']);
};