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');
36 lines
624 B
JavaScript
36 lines
624 B
JavaScript
/**
|
|
* Grunt Task Wrangler
|
|
*
|
|
* @copyright Copyright © 2016 Locomotive
|
|
* @license Licensed under the MIT license.
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
module.exports = function (grunt)
|
|
{
|
|
var path = require('path');
|
|
|
|
require('load-grunt-config')(grunt, {
|
|
configPath: path.join(process.cwd(), 'build/grunt/config'),
|
|
data: {
|
|
paths: {
|
|
grunt: 'build/grunt',
|
|
npm: 'node_modules',
|
|
js: {
|
|
src: 'assets/scripts',
|
|
dist: 'www/assets/scripts'
|
|
},
|
|
css: {
|
|
src: 'assets/styles',
|
|
dist: 'www/assets/styles'
|
|
},
|
|
img: {
|
|
src: 'assets/images',
|
|
dist: 'www/assets/images'
|
|
}
|
|
}
|
|
}
|
|
});
|
|
};
|