-
Notifications
You must be signed in to change notification settings - Fork 80
/
Gruntfile.js
76 lines (71 loc) · 1.67 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
srcPath = 'src';
// Files will be concatenated in the following order
coreSrc = [
'core/license',
'core/core.js',
'libs/jsextensions.js',
'libs/is.js',
'libs/convert.js',
'libs/html.js',
'libs/key.js',
'libs/canvas.js',
'libs/collision.js',
'core/Interface.js',
'data/Vector.js',
'data/Color.js',
'data/Gradient.js',
'core/Drawable.js',
'data/SpriteMap.js',
'shapes/Shape.js',
'shapes/Ellipse.js',
'shapes/Polygon.js',
'shapes/Line.js',
'shapes/Rectangle.js',
'shapes/Quad.js',
'shapes/Text.js',
'shapes/Grid.js',
'core/App.js',
'data/Sound.js',
'core/Loader.js',
'extras/box2dweb_iio.js'
].map(function(filename) { return srcPath + '/' + filename });
module.exports = function(grunt) {
grunt.initConfig({
concat: {
options: {
separator: '\n'
},
iio: {
src: coreSrc,
dest: 'build/iio.js',
nonull: true
},
debug: {
src: ['<%= concat.iio.dest %>', 'src/extras/*.js'],
dest: 'build/iio.debug.js',
nonull: true
}
},
uglify: {
iio: {
options: {
preserveComments: require('uglify-save-license')
},
files: {
'build/iio.min.js': ['<%= concat.iio.dest %>']
}
},
/*debug: {
files: {
'build/iio_debug.min.js': ['<%= concat.debug.dest %>']
}
}*/
}
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('dev', ['concat:iio' ]);
grunt.registerTask('debug', ['concat', 'uglify']);
grunt.registerTask('default', ['concat:iio', 'uglify:iio']);
};