klei/gulp-inject

svg to pug example

CydGoblin opened this issue · 0 comments

The newest release is compatible with pug but I'm having trouble making it work, it still outputs html tags. Here my task so far:

gulp.task('default', function () {
    var svgs = gulp
        .src('src/*.svg')
        .pipe(svgstore({ inlineSvg: true }));

    function fileContents (filePath, file) {
        return file.contents.toString();
    }

    return gulp
        .src('src/svg.pug')
        .pipe(inject(svgs, { transform: fileContents }))
        .pipe(gulp.dest('src'));
});