mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-04-14 19:47:03 +00:00
add imagemin task to grunt, to shrink file size after spritesmith
This commit is contained in:
parent
0fb911016a
commit
24f35d84e7
2 changed files with 17 additions and 1 deletions
17
Gruntfile.js
17
Gruntfile.js
|
|
@ -75,6 +75,20 @@ module.exports = function(grunt) {
|
|||
|
||||
sprite: sprite,
|
||||
|
||||
imagemin: {
|
||||
spritesmith: {
|
||||
options: {
|
||||
optimizationLevel: 7
|
||||
},
|
||||
files: [{
|
||||
expand: true,
|
||||
flatten: true,
|
||||
src: ["common/dist/sprites/*.png"],
|
||||
dest: "common/dist/sprites/"
|
||||
}]
|
||||
}
|
||||
},
|
||||
|
||||
cssmin: {
|
||||
dist: {
|
||||
options: {
|
||||
|
|
@ -209,7 +223,7 @@ module.exports = function(grunt) {
|
|||
});
|
||||
|
||||
// Register tasks.
|
||||
grunt.registerTask('compile:sprites', ['clean:sprite', 'sprite', 'cssmin']);
|
||||
grunt.registerTask('compile:sprites', ['clean:sprite', 'sprite', 'imagemin', 'cssmin']);
|
||||
grunt.registerTask('build:prod', ['loadManifestFiles', 'clean:build', 'browserify', 'uglify', 'stylus', 'cssmin', 'copy:build', 'hashres','prepare:staticNewStuff']);
|
||||
grunt.registerTask('build:dev', ['browserify', 'stylus', 'prepare:staticNewStuff']);
|
||||
grunt.registerTask('build:test', ['test:prepare:translations', 'build:dev']);
|
||||
|
|
@ -250,6 +264,7 @@ module.exports = function(grunt) {
|
|||
grunt.loadNpmTasks('grunt-concurrent');
|
||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||
grunt.loadNpmTasks('grunt-spritesmith');
|
||||
grunt.loadNpmTasks('grunt-contrib-imagemin');
|
||||
grunt.loadNpmTasks('grunt-hashres');
|
||||
grunt.loadNpmTasks('grunt-karma');
|
||||
|
||||
|
|
|
|||
|
|
@ -92,6 +92,7 @@
|
|||
"event-stream": "^3.2.2",
|
||||
"expect.js": "~0.2.0",
|
||||
"glob": "^4.3.5",
|
||||
"grunt-contrib-imagemin": "^0.9.4",
|
||||
"istanbul": "^0.3.14",
|
||||
"karma": "~0.10.2",
|
||||
"karma-chai-plugins": "~0.1.0",
|
||||
|
|
|
|||
Loading…
Reference in a new issue