Skip to content

Commit af9b1f8

Browse files
authored
Update README.md
1 parent cadfa50 commit af9b1f8

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

README.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,31 @@ Sample project prepared for create and publish React components on [npm](https:/
44

55

66
## Features
7-
- Webpack for building
7+
- Use Webpack for building
88
- Sass ready (sass-loader). Just ```import 'your/sass/files.scss'``` from your components
99
- ES2016 ready (babel loader).
10-
- Import images ready (url-loader). Just ```import myImage from 'my/image/dir'```
10+
- Import images from your components (url-loader). Just ```import myImage from 'my/image/dir/my_image.png'```
1111

1212
## How to use
1313
1. Clone the repo: ```git clone git@github.com:nmartinezb3/npm-react-component-starter.git```
1414
2. Change package name, author, and all stuff in ```package.json```
1515
3. Install all dependencies: ```npm install```
1616
4. Create your components under ```src/components/```
17-
5. Export them from from src/index.js:
17+
5. Export them from ```src/index.js```:
18+
```
19+
import MyComponent from './components/MyComponent';
20+
import MyOtherComponent from './components/MyOtherComponent';
21+
22+
export {
23+
MyComponent,
24+
MyOtherComponent
25+
}
26+
```
27+
1828
6. Make a build: ```npm run build```
19-
7. Publish to npm: ```npm publish``` (You must have an npm account)
20-
8. Now you are ready to install the package with ```npm install my-react-components```
29+
7. Publish to npm: ```npm publish``` (you must have an npm account)
30+
8. Install the package from other project: ```npm install my-react-components```
31+
9. Import the components: ```import { MyComponent, MyOtherComponent } from 'my-react-components'```
2132

2233

2334
## Preview components during develop

0 commit comments

Comments
 (0)