1.0.0 • Published 8 years ago

gulp-amp-svg-preview v1.0.0

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

gulp-amp-svg-preview

Gulp plugin for previewing Amplience substitutions in SVGs

Installation

$ npm install --save gulp-amp-svg-preview

Usage

To preview SVGs we pipe them into the plugin using gulp.src. A preview url will be generated for each SVG.

var ampSvgPreview = require('gulp-amp-svg-preview');
var previewOpts = {
  di: {
    clientName: '<your_client_name_here>'
  }
};

gulp.src('svg/merged/*.svg')
  .pipe(ampSvgPreview(previewOpts, function (err, url) {
    if(err) {
      // handle err
    }
    // handle url
  }))

Options

Default options:

var previewOpts = {
  auth: {
    protocol: 'https',
    host: 'auth.adis.ws',
    pathname: 'oauth/token'
  },
  preview: {
    protocol: 'https',
    host: 'dm-preview-service.adis.ws',
    pathname: 'preview'
  },
  di: {
    protocol: 'https',
    host: 'i1.adis.ws',
    companyName: 'testCompany123',
    namespace: 'preview'
  }
}

License

Apache-2.0 © Amplience