Advertisement
Guest User

Untitled

a guest
Feb 21st, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 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: "../sprire/sprite.svg",
  24. render: {
  25. scss: {
  26. dest: "../../../src/css/components/_sprite.scss",
  27. template: "./src/css/templates/sprite-template.scss"
  28. }
  29. }
  30. }
  31. }
  32. }))
  33. .pipe($.gulp.dest($.config.root + '/img'))
  34. })
  35. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement