Git Product home page Git Product logo

optimize-svg's Introduction

安装

npm install spider-optimize-svg -g

#

npm install spider-optimize-svg --save-dev

运行

spider-svg ./svg -i appid -k appkey
# 使用了百度翻译,请注册后获取

功能

  1. 将目录下的中文文件名/特殊符号文件名/非驼峰形式的文件名一致修改为驼峰英文命名
  2. 生成js引入导出文件
  3. 组件名称为 {驼峰}Icon
  4. 文件名称为 {驼峰}.svg

##Tips 百度翻译限流,文件多的话时间较久

原始目录 ./svg下的结构

├── 中文
│   └── 错误.svg
├── 列表
│   └── 错误.svg
└── 菜单_12 -.svg

2 directories, 2 files

优化后的目录结构

├── Chinese
│   ├── Error.svg
│   └── index.js
├── List
│   ├── Error.svg
│   └── index.js
├── Menu12.svg
└── index.js

生成的引用文件

// index.js

import Menu12Icon from './Menu12.svg';

export {
    Menu12Icon
}

optimize-svg's People

Contributors

viisionary avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.