Answer the question
In order to leave comments, you need to log in
How to convert images to base64 and save to file?
Hello dear.
1) I need to take pictures from a certain folder.
2) Convert them all to base64 in a specific file
3) In the file, they must be written to an object (which we will create ourselves with the name IMAGES)
4) The command should look like this:
gulp base64-images folderName (folderName -аргумент(путь от куда берутся картинки))
const gulp = require('gulp');
var gulpBase64 = require("gulp-to-base64");
gulp.task('base64-images', function(args) {
return gulp.src("./assets/konan/images/*.{png,jpg,jpeg,mp3,svg,ttf}")
.pipe(gulpBase64({
outPath: "images.js" //output file path
}))
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question