Skip to content

🚀 React + Typescript + Parcel Starter Project

License

Notifications You must be signed in to change notification settings

YagoLopez/react-parcel

Repository files navigation

React + Parcel + TypeScript

  • Forked from this repository.

  • DEMO

  • Zero configuration

  • Fast initial build times

  • Fast sucesive rebuild times

  • Hot reload supported by default

  • Dynamic imports supported by default

  • Test configuration using Jest + Enzyme

  • File proccessors for Jest (css|less|jpg|jpeg|png|gif|eot|otf|webp|svg) etc.

  • React + ReactDOM (ver.16)

  • Parcel bundler

Setup

  • Clone or download the repository
  • If not installed, install yarn package manager
  • Go to project folder and run in command line
$ yarn

Run

$ yarn develop

Execute the command and you can run & test the application on localhost:1234 in the browser.

Build

$ yarn build

The default output directory is /dist. You can change the destination wherever you want.

// package.json
// ...
"scripts": {
  // ...
  "build": "parcel build ./src/index.html -d YOUR_OUTPUT_DIR --public-url ./" // <- Change here
}
// ...

Test

$ yarn test        # run tests suites once
$ yarn test:watch  # watch mode
$ yarn coverage    # code coverage
  • Config tests in config folder

  • You have to create __tests__ directory at the same location of files which you want to test.

  • Test file's name should be SOURCE.test.ts/tsx/js or SOURCE.spec.ts/tsx/js.

    Back to top ⬆️