https://github.com/loopmode/react-alt-starter
https://github.com/loopmode/react-alt-starter
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/loopmode/react-alt-starter
- Owner: loopmode
- License: mit
- Created: 2015-11-19T09:26:50.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-11-19T09:28:23.000Z (over 10 years ago)
- Last Synced: 2025-02-26T02:43:16.506Z (about 1 year ago)
- Language: JavaScript
- Size: 3.78 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# React component starter
Quickstart your react component development and use components as npm modules!
## Usage
Make sure you have [node.js](https://nodejs.org) installed and `git clone git@github.com:loopmode/react-component-starter.git` this repository.
Then install and start the project:
cd react-component-starter
npm install
npm start
### build
`npm run build` to create a transpiled ES5 version of your `./src` and copy it to `./lib`, which is the module you actually export.
`npm run build-watch` to keep rebuilding whenever any source files change.
### react-dev-server
Run `npm start` to start a development server and preview your component in the browser, standalone.
### npm link
Run `npm link` in the root folder of the package.
Then, in your actual projects, install it with `npm link your-package-name` and use it just like you would use any other npm module.
Now your component is symlinked into your project, so any changes you make to your component are available dependent projects right after you build your sources. Keep the `build-watch` to rebuild whenever you change your sources.
### in your actual projects
Import or require your component using ES6:
import MyModule from 'your-package-name';
or using ES5 CommonJS:
var MyModule = require('your-package-name');
## Notes
- To work on multiple standalone components simultanously, you need to tweak the `DEV_SERVER.port` settings in `webpack.config.js`.
## Todos
- Install testing environment
- Trigger hot reload in dependent projects. It must be possible!