@proscom/gulp-svg-vue
Advanced tools
Comparing version 0.1.1 to 0.1.2
13
index.js
@@ -97,3 +97,8 @@ const through = require('through2'); | ||
module.exports = function gulpSvgVue(options) { | ||
const { aggregate, createIndex, extension = 'vue' } = options; | ||
const { | ||
prefix = 'Icon', | ||
aggregate, | ||
createIndex, | ||
extension = 'vue' | ||
} = options; | ||
@@ -130,8 +135,8 @@ const allIcons = []; | ||
iconPath[iconPath.length - 1] = file.stem; | ||
iconPath.unshift('Icon'); | ||
iconPath.unshift(prefix || ''); | ||
const iconName = camelcase(iconPath, { pascalCase: true }); | ||
const basePath = iconPath.slice(0, iconPath.length - 1); | ||
if (aggregate) { | ||
// Group icons by aggregator | ||
const basePath = iconPath.slice(0, iconPath.length - 1); | ||
const baseIcon = camelcase(basePath, { pascalCase: true }); | ||
@@ -159,3 +164,3 @@ if (!baseIconsMap[baseIcon]) { | ||
name: iconName, | ||
path: `${iconPath.slice(1).join('/')}/${iconName}` | ||
path: basePath.slice(1).join('/') | ||
}); | ||
@@ -162,0 +167,0 @@ |
{ | ||
"name": "@proscom/gulp-svg-vue", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
@@ -40,3 +40,6 @@ # `@proscom/gulp-svg-vue` | ||
// Icon file extension can be overridden | ||
extension: 'vue' | ||
extension: 'vue', | ||
// Icon file prefix can be overridden | ||
// Default prefix is 'Icon' | ||
prefix: 'MyIcon' | ||
}) | ||
@@ -43,0 +46,0 @@ ) |
9049
189
107