Home

Awesome

rollup-plugin-sprite

converts set of images into a spritesheet and SASS/LESS/Stylus mixins based on spritesmith for Rollup.js.

Build Status NPM version NPM package download of month Coverage Status

Installation

npm i rollup-plugin-sprite -D

Usage

import spritesmith from "rollup-plugin-sprite";

export default {
  input: "src/main.js",
  plugins: [
    spritesmith({
      src: {
        cwd: "./src/ui/images/sprite",
        glob: "**/*.png"
      },
      target: {
        image: "./src/ui/images/sprite.png",
        css: "./src/ui/sass/sprite.scss"
      },
      cssImageRef: "../images/sprite.png",
      output: {
        image: "./dist/images/sprite.png"
      },
      spritesmithOptions: {
        padding: 5
      }
    })
  ]
};

Config

License

Released under the MIT license.