Skip to content

Tool for replacing src="path" by import statement for React components

Notifications You must be signed in to change notification settings

uniqB/path-to-import

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

path-to-import

Tool for replacing src="path" by import statement for React components.

path-to-import -h or p2i -h for usage

Example:

p2i --src=./src --ext=js,jsx --prefix=assets

Before:

<img src="images/[email protected]" alt="" />

After:

import logo2xPng from 'assets/images/[email protected]';
.
.
.
<img src={logo2xPng} alt="" />

About

Tool for replacing src="path" by import statement for React components

Resources

Stars

Watchers

Forks

Packages

No packages published