Skip to content

Instantly share code, notes, and snippets.

@ebhoren
Last active December 11, 2015 20:29
Show Gist options
  • Save ebhoren/4656066 to your computer and use it in GitHub Desktop.
Save ebhoren/4656066 to your computer and use it in GitHub Desktop.
/*global module:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
spritesheet: {
compile: {
options: {
output: {
legacy: {
outputImage: 'img/spritesheet-legacy.png',
outputStyleFilePath: 'styles/spritesheet-legacy.css',
selector: '.sprite-legacy',
filter: function( fullpath ){ return fullpath.indexOf( "legacy" ) >= 0; }
},
spritesheet: {
outputImage: 'img/spritesheet.png',
outputStyleFilePath: 'styles/spritesheet.css',
selector: '.sprite',
filter: function( fullpath ){ return fullpath.indexOf( "spritesheet" ) >= 0; }
}
},
outputCss: 'styles/spritesheet.css'
},
files: { '': 'src/img/**/*' }
}
},
watch: {
spritesheets: {
files: ['src/img/**/*'],
tasks: 'spritesheet'
}
}
});
// Modules
grunt.loadNpmTasks('node-spritesheet');
// Default task.
grunt.registerTask('default', 'spritesheet');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment