Last active
April 17, 2017 22:25
-
-
Save david-j-davis/7280e839ecd596c822af9fcb81eb8c51 to your computer and use it in GitHub Desktop.
Creates an svg spritesheet from svgs located in a project folder using gulp-svg-sprite module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var svgSprite = require('gulp-svg-sprite'); | |
gulp.task('svg-sprite', function () { | |
console.log('Creating svg sprite...'); | |
// Basic configuration example | |
var config = { | |
mode: { | |
css: { | |
dest: '.', | |
sprite: './img/sprite.svg', | |
render: { | |
scss: { | |
dest: './_sprite-svg.scss' | |
} | |
}, | |
} | |
} | |
}; | |
return gulp.src('**/*.svg', {cwd: './path/to/images/'}) | |
.pipe(svgSprite(config)) | |
.pipe(gulp.dest('./path/to/output')); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment