mod-sprite

auto magically generate css sprites

sprite

auto magically generate css sprites

Support by https://github.com/iazrael/ispriter

$ mod sprite ./css/mian.css
// Modfile 
module.exports = {
    tasks: {
        sprite: {
            "source": "./css/",               // 必选, CSS文件目录 
            "dest": "./dist/css/",            // 可选, 生成CSS文件目录, 默认覆盖 source 目录CSS文件 
            "sourceImageRoot": "./img/",      // 可选, 默认与 source 目录相同 
            "destImageRoot": "./sprites/",    // 可选, 默认 "./sprites/", 最终会变成合并后的的图片路径写在CSS文件 
            "maxSize": 60,                    // 可选, 图片容量的最大大小, 单位 KB, 默认 0 
            "margin": 5,                      // 可选, 合成之后, 图片间的空隙, 默认 0 
            "prefix": "sprite_",              // 可选, 输出的图片格式 
        }
    },
 
    targets: {
        dist: "sprite"
    }
};