The plugin replaces 'svgmin' and 'svgstore' with an all-in-one and highly flexible solution for managing SVG assets.
Changes:
- Deleted 'assets/images/sprite/', SVG images can live anywhere within the source image directory;
- When compiled to 'www/assets/images/sprite.svg', the plugin generates an HTML file in 'assets/images/sprite.symbol.html' that serves as an index of the spritesheet's contents;
- A separator ("--") is used when traversing a directory structure for the symbol ID (e.g, 'sprite.svg#icons--social--twitter');
30 lines
592 B
JavaScript
30 lines
592 B
JavaScript
module.exports = {
|
|
options : {
|
|
svg: {
|
|
xmlDeclaration : false,
|
|
namespaceIDs : true,
|
|
doctypeDeclaration : false,
|
|
cleanupNumericValues : true,
|
|
removeTitle : true,
|
|
removeDesc : true
|
|
}
|
|
},
|
|
prod: {
|
|
expand : true,
|
|
cwd : '<%= paths.img.src %>',
|
|
src : [ '**/*.svg', '!sprite.svg' ],
|
|
dest : '<%= paths.img.dist %>',
|
|
options : {
|
|
mode: {
|
|
symbol: {
|
|
dest : '.',
|
|
sprite : 'sprite.svg',
|
|
example : {
|
|
dest: '../../../build/sprite.symbol.html'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|