Merge a folder of svg files into a single file
This plugin requires Grunt ~0.4.
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-svg-merge --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-svg-merge');
To configure the task just pass in a src
directory, with subfolders for each icon and a dest
directory.
svgmerge: {
files: {
src: ['icons'],
dest: 'icons-out'
}
}
Default: -out
Type: String
Append a suffix to the end of every output file. Ex: arrow.svg
becomes arrow-out.svg
.
svgmerge: {
files: {
src: ['icons'],
dest: 'icons-out',
options: {
outputSuffix: '-foo'
}
}
}
Copyright (c) 2014 Rob Dodson. Licensed under the MIT license.