forked from BYU-ODH/vocal-abduction
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
97 lines (95 loc) · 2.3 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
module.exports = function(grunt) {
var ASSET_DIR = 'app/assets/';
var BUILD_DIR = 'build/';
var SPRITE_DIR = ASSET_DIR + 'sprites/';
var SPRITE_PDF = ASSET_DIR + 'sprites/sprites.pdf'
grunt.initConfig({
wiredep: {
target: {
src: [
'app/index.html'
]
}
},
texturepacker: {
sprites: {
options: {
trimMode: 'None',
multipack: false,
pngOptLevel: 0,
sizeConstraints: 'AnySize',
algorithm: 'Basic',
disableRotation: true,
output: {
sheet: {
file: SPRITE_DIR + '<%= grunt.task.current.args[0] %>/sheet.png',
format: 'png'
},
data: {
file: SPRITE_DIR + '<%= grunt.task.current.args[0] %>/sheet.json',
format: 'json'
}
}
},
src: [BUILD_DIR + '<%= grunt.task.current.args[0] %>/*.png'],
}
},
responsive_images: {
sprites: {
options: {
newFilesOnly: false,
sizes: [
{
dir: 'large',
width: '20%'
},
{
dir: 'medium',
width: '15%'
},
{
dir: 'small',
width: '10%'
}
]
},
files: [{
cwd: SPRITE_DIR + 'orig/',
expand: true,
src: ['*.png'],
custom_dest: BUILD_DIR + '{%= dir %}'
}]
}
},
img: {
sprites: {
src: [
SPRITE_DIR + '/small/sheet.png',
SPRITE_DIR + '/medium/sheet.png',
SPRITE_DIR + '/large/sheet.png'
]
}
},
clean: {
build: [BUILD_DIR+'/*'],
sprites: [SPRITE_DIR + '/*/sheet.{png,json}']
}
});
grunt.loadNpmTasks('grunt-wiredep');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-texturepacker');
grunt.loadNpmTasks('grunt-img');
grunt.loadNpmTasks('grunt-responsive-images');
grunt.registerTask('sprites',
[
'clean:sprites',
'responsive_images:sprites',
'texturepacker:sprites:small',
'texturepacker:sprites:medium',
'texturepacker:sprites:large',
'img:sprites',
'clean:build'
]
);
grunt.registerTask('default', 'wiredep')
};