1.0.3 • Published 5 years ago

@ephox/svgroup v1.0.3

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
5 years ago

Bundler for SVG files

This project contains resources for bundling SVG files. Currently a gulp plugin is provided which can take one or more 'producers' as an option which will generate the output files from the SVGs fed to them.

Installation

svgroup is available as an npm package. You can install it via the npm package @ephox/svgroup

Install from npm

npm install @ephox/svgroup

Usage

const gulpSvgroup = require('@ephox/svgroup/gulp-svgroup');
const svgroup = require('@ephox/svgroup');
const gulp = require('gulp');

gulp.task('default', function () {
  return gulp.src('svg_sample/**/*.svg')
    .pipe(gulpSvgroup({
      producer: svgroup.providerProducer,
      options: { ... }
    }))
    .pipe(gulp.dest('dist'));
});
Existing producers and their default options
  • Provider
    {
      producer: svgroup.providerProducer,
      options: {
        filename: 'SvgProvider.ts',
        normalizeKeys: false,
        head: 'export const getAll = () => (',
        tail: ');',
        quoteType: 'single',
        quoteKeys: true,
      }
    }
    %head%{
      %filename%: %content%,
      // ...
    }%tail%
  • Enum map
    {
      producer: svgroup.enumMapProducer,
      options: {
        filename: 'SvgEnumMap.ts',
        enumName: 'Enums',
        normalizeValues: false,
        quoteType: 'single'
      }
    }
    enum %name% {
      %filename%: %filename%,
      // ...
    }
  • Preview
    {
      producer: svgroup.previewProducer,
      options: {
        filename: 'Preview.html',
        title: 'Svg Icons Preview'
      }
    }
1.0.3

5 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago