A quick starter repo for React projects.
- React
- Babel
- Webpack
- Jasmine + Karma + PhantomJS
npm install
webpack
npm test
While developing, you'll likely want to preview your changes locally.
webpack --watch
python -m SimpleHTTPServer
open http://localhost:8000
You can deploy with surge.sh
, or with your favorite method of deploying static sites.
npm install -g surge
surge
├── LICENSE
├── README.md
├── app.js
├── components
│ ├── Hello.js
│ └── tests
│ └── hello-test.js
├── index.html
├── karma.conf.js
├── package.json
├── static
│ └── bundle.js
├── tests.webpack.js
└── webpack.config.js
Configs:
package.json
contains your JavaScript dependencies and project config; most notably it sets upnpm test
to triggerkarma start
webpack.config.js
: webpack configurationtests.webpack.js
: identifies all test fileskarma.conf.js
: configures Karma, for running tests
The actual app:
index.html
is the HTML page; it loads your bundled JavaScript fromstatic/bundle.js
, which is produced by Webpackapp.js
is the JavaScript entry point; it renders the<Hello>
React component into the pageHello.js
contains the<Hello>
React componenthello-test.js
contains a simple test