-
Notifications
You must be signed in to change notification settings - Fork 61
/
Gruntfile.js
39 lines (32 loc) · 1.1 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
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sprite:{
all: {
src: [
'skin/src/*.png',
'skin/src/icons_small/*.png',
'skin/src/icons_big/*.png'
],
dest: 'skin/spritesheet_v5.png',
destCss: 'skin/spritemap_v5.json',
cssTemplate: function (data) {
var result = [];
data.sprites.forEach(function (sprite) {
result.push({
name: sprite.name,
x: sprite.x,
y: sprite.y,
width: sprite.width,
height: sprite.height
});
});
return JSON.stringify(result,undefined,2);
}
}
}
});
grunt.loadNpmTasks('grunt-spritesmith');
// Default task(s).
grunt.registerTask('sprites', ['sprite']);
};