Skip to content

A Node script for converting SVG icons to React components.

Notifications You must be signed in to change notification settings

Huddly/icons-transpiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Icons transpiler

A Node script for converting SVG icons to React components.

Installation & Setup

Run the following command to install the library:

npm install Huddly/icons-transpiler --save-dev

Add the following scripts to your package.json:

...
"scripts": {
    "build": "icons",
    "readme": "icons readme",
},
...

Add build.config.json to your project root. It should look something like this:

{
	"entry": "src",
	"output": ".",
	"readme": {
		"output": "README.md",
		"template": "README.md.template"
	}
}

This step is optional, by default the entry point is ./src and the output is .. No README is generated by default.

Finally

Run npm run build to generate the icon components.

Generate a README

Setup a README.md.template file in your project root. It should look something like this:

# A title

A description

## Icon packages and imports

[icons-declaration]

The "[icons-declaration]" is a placeholder for the generated icons declaration.

You are free to change the placeholder name by adding a declarationTag property to the readme section of build.config.json.

About

A Node script for converting SVG icons to React components.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •