gulp-img64-html
v0.1.1
Published
Based in 247even's gulp-img64: Convert and replace image-files within your DOM/HTML to base64-encoded data.
Downloads
3
Maintainers
Readme
gulp-img64-html
Based in 247even's gulp-img64. Convert and replace image-files within your DOM/HTML to base64-encoded data.
Gulp Task:
var gulp = require('gulp');
var img64Html = require('gulp-img64-html');
gulp.task('default', function () {
gulp.src('index.html')
.pipe(img64Html())
.pipe(gulp.dest('path'));
});
index.html - Before:
<img src="sample.png" />
path/index.html - After:
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAACksUlEQVR42ux9B5glV3F195ud2dkkaSXxE22SDTYigwwWSUQHsAgCEyTAgBAgE0wGA79JwiKDAIlkhEgiRxF[and so on...]">
Optional: ignoreExternal
Default: false
- Boolean
img64Html({
ignoreExternal: true // will skip http & https
})
License
MIT © 247even