57.2.28 • Published 7 years ago
rj-cp v57.2.28
react-webpack-component
Base structure in Webpack 4 for the creation of npm modules in React
Installation
1. Clone
git clone https://github.com/kevoj/react-webpack-component.git your-react-component-name
cd [your-react-component-name]
npm install
2. Set name of the library
Replace in package.json
{
"name": "your-react-component-name",
...
}
3. Create Link
npm run build
npm link
Development
Start
Watch changes in mode development
npm start
Build
Compile in mode production
npm run Build
Structure
Test the component in a project
cd Existing-React-Project
npm link your-react-component-name
At this point you can already use your component, usage:
import React, { Component } from 'react';
import { Example } from 'your-react-component-name'
class HelloWorld extends Component {
render() {
return (
<Example />
);
}
}
export default HelloWorld;
Production
Publish in NPM
1. Compile to production
npm run build
2. Login
npm login
# login with your credentials in https://www.npmjs.com/
3. Upload package
Note: Verify your version of the component in package.json, you can not upload the same version twice
npm publish
# Available in https://www.npmjs.com/package/your-react-component-name
Now, you can install your package with:
npm install your-react-component-name--save
# :)
License
MIT © Leonardo Rico
57.2.28
7 years ago
57.2.27
7 years ago
57.2.26
7 years ago
57.2.25
7 years ago
57.2.24
7 years ago
57.2.23
7 years ago
7.2.23
7 years ago
7.2.22
7 years ago
7.2.15
7 years ago
7.2.14
7 years ago
7.2.13
7 years ago
7.2.12
7 years ago
7.2.11
7 years ago
7.2.10
7 years ago
7.2.9
7 years ago
7.2.8
7 years ago
7.2.7
7 years ago
7.2.6
7 years ago
7.2.5
7 years ago
7.2.3
7 years ago
7.2.2
7 years ago
6.2.2
7 years ago
5.2.2
7 years ago
4.2.2
7 years ago
3.2.2
7 years ago
2.2.2
7 years ago
1.2.2
7 years ago