Skip to content

norbertohdez/gulp-img64-html

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gulp-img64-html Build Status

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

About

Based in gulp-img64 package. Extra option added to skip external images (http/https). Repo created due to lack of attention to PRs on its original repo

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published