gulp-amp-svg-preview
v1.0.0
Published
Gulp plugin for making requests to the Amplience SVG preview service
Downloads
3
Readme
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