A basic React starter using Parcel, a zero configuration web application bundler.
Library | Version |
---|---|
react | 16.2.0 |
normalize.css | 7.0.0 |
Library | Version |
---|---|
eslint | 4.15.0 |
jest | 22.1.1 |
parcel-bundler | 1.4.1 |
Go through the following steps to get started
-
Clone this repo
git clone https://github.com/nishanbajracharya/parcel-react.git
-
Go to the project directory and remove the git config
cd parcel-react && rm -r .git
-
Install all the dependencies
npm install
To start developing, open the project in a code editor and edit app.js
in the src/js
directory. Hot module replacement and development server are available in the parcel-bundler out of the box, so run the project using the following commands.
-
Development server (http://localhost:3000/)
npm run start
The port the server runs in can be changed by updating
-p 3000
argument in the start script in thepackage.json
file. -
Production build
npm run build:production
The build will be available in the
dist/
directory. -
Lint
npm run lint npm run lint:fix
The project comes with a predefined eslint config with recommended react configs. Lookup
eslintrc.json
within the project to learn more. Runlint:fix
to automatically fix lint issues. -
Test
npm run test npm run test:update
All tests in the project are performed using
jest
. The test file is defined using thespec
extension, eg.app.spec.js
. An example snapshot test is included in this starter. Runtest:update
to update the snapshots.
To contribute, follow one of the two options
-
Open an Issue
Open an issue detailing:
- What the issue is
- Steps to reproduce
- Possible solutions
Note: These details are recommended but are entirely optional.
-
Send a Pull Request
Fork this project and send a pull request to the
master
branch.
This project is licensed under the MIT License.