1.5.0 • Published 10 years ago

gulp-spritezero v1.5.0

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

gulp-spritezero

Gulp plugin for generating spritesheets using spritezero for Mapbox.

Install

npm install gulp-spritezero

Usage

The following gulp task will generate dest/sprite.png and dest/sprite.json from all SVG files in the src directory.

var gulp = require('gulp');
var spritezero = require('gulp-spritezero');

gulp.task('spritezero', function() {
  return gulp.src('src/**/*.svg')
    .pipe(spritezero({
      scales: [ 1 ]
    }))
    .pipe(gulp.dest('./dest'));
});

If no options are passed to the plugin, 4 files will be generated by default:

  • dest/sprite.png
  • dest/sprite.json
  • dest/sprite@2x.png
  • dest/sprite@2x.json

Options

KeyValue TypeDefaultDescription
scalesArray.<Number>[ 1, 2 ]Array of scales to generate sprites for
nameString'sprite'Base name for the sprite files
sdfBooleanfalseRender the sprites in SDF format

Author

Matthew Wagerfield: @wagerfield

License

Licensed under MIT. Enjoy.

1.5.0

10 years ago

1.4.0

10 years ago

1.3.0

10 years ago

1.2.0

10 years ago

1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.0

10 years ago