Last active
August 29, 2015 14:09
-
-
Save davidensinger/afda0fe350e6d8f528b9 to your computer and use it in GitHub Desktop.
Grunt Task Configuration for SVG in CSS Backgrounds
This file contains hidden or 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
// clean the generated icons directory that’s used with grunticon | |
clean: { | |
icons: ['<%= pathTo.jcrRoot %><%= pathTo.projectDesigns %>static/icons/dist/'] | |
}, | |
// minify SVGs | |
svgmin: { | |
options: { | |
plugins: [ | |
{ | |
removeViewBox: false | |
}, { | |
removeUselessStrokeAndFill: false | |
} | |
] | |
}, | |
build: { | |
files: [{ | |
expand: true, | |
cwd: '<%= pathTo.jcrRoot %><%= pathTo.projectDesigns %>static/icons/source/raw/', | |
src: ['*.svg'], | |
dest: '<%= pathTo.jcrRoot %><%= pathTo.projectDesigns %>static/icons/source/compressed/' | |
}] | |
} | |
}, | |
grunticon: { | |
build: { | |
files: [{ | |
expand: true, | |
cwd: '<%= pathTo.jcrRoot %><%= pathTo.projectDesigns %>static/icons/source/compressed/', | |
src: ['*.svg'], | |
dest: '<%= pathTo.jcrRoot %><%= pathTo.projectDesigns %>static/icons/dist/' | |
}] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment