Advertisement
Guest User

Untitled

a guest
Jan 12th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. 'use strict';
  2.  
  3. module.exports = function() {
  4. $.gulp.task('sprite:svg', function() {
  5. return $.gulp.src('./src/sprite/*.svg')
  6. .pipe($.gp.svgmin({
  7. js2svg: {
  8. pretty: true
  9. }
  10. }))
  11. .pipe($.gp.cheerio({
  12. run: function ($) {
  13. $('[fill]').removeAttr('fill');
  14. $('[stroke]').removeAttr('stroke');
  15. $('[style]').removeAttr('style');
  16. },
  17. parserOptions: { xmlMode: true }
  18. }))
  19. .pipe($.gp.replace('>', '>'))
  20. .pipe($.gp.svgSprite({
  21. mode: {
  22. symbol: {
  23. sprite: "../sprite.svg"
  24. }
  25. }
  26. }))
  27. .pipe($.gulp.dest($.config.root + '/img'))
  28. })
  29. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement