Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/albertogasparin/react-boilerplate
Simple boilerplate to get up and running with Webpack + React + SCSS
https://github.com/albertogasparin/react-boilerplate
Last synced: about 4 hours ago
JSON representation
Simple boilerplate to get up and running with Webpack + React + SCSS
- Host: GitHub
- URL: https://github.com/albertogasparin/react-boilerplate
- Owner: albertogasparin
- Created: 2015-01-29T12:13:04.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-02-13T12:20:32.000Z (almost 10 years ago)
- Last Synced: 2024-04-28T04:34:43.122Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 195 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
React Bower boilerplate
=====================The minimal dev environment to get started with React.
Includes:
- React
- React router
- Reflux
- Node Sass
- Source maps output
- Karma + Jasmine for testing## Development Server
```
npm install
npm run server
open http://localhost:3000
```Now edit `app/Application/index.jsx`.
Your changes will appear without reloading the browser.## How-to's
### Add Javascript libraries with Bower
Install the library as usual. Then open `webpack.config.js` and add an additional line after the `config` variable:
```
config.addVendor('libname', '/libpath/libfile.js');
```Where `libname` is the name that you will use with require (es: 'jquery') and `libpath` is the library path **relative** to the Bower folder (so without `bower_components`). If you want to use different files between dev/production environments, then use `isProduction` flag.
## Testing
To test with Karma, install karma-cli or run:
```
npm run test
```For an example of how to setup a test for a Component, have a look at the `Application/__tests__`.
I've written some test helpers in order to easily mock/stub required modules and deal with react router.### Useful resources
http://substantial.com/blog/2014/11/11/test-driven-react-how-to-manually-mock-components/
### Examples
https://github.com/WRidder/react-spa
https://github.com/TYRONEMICHAEL/react-component-boilerplate