An opinionated setup of Parcel that works right out of the box! (Typescript + MobX) @author Justin Hedani
Parcel (1.10.0)
Yarn (1.10.1)
Develop projects locally with Parcel's dev server and HMR:
$ git clone https://github.com/jkhedani/parcel-create-react-app.git my-awesome-proj
$ cd my-awesome-proj
$ cp .env.sample .env
$ yarn
$ yarn start
The create-react-app
script/package can't deal with simple things like making the changing of environmental variables and deployment locations easy so:
a) Modify .env.local for local env adjustments
b) edit the package the JSON when building for staging or production
c) Use a Parcel bootstrap for first
Deploy your static bundle using a Docker container:
$ yarn build
$ yarn docker:build
$ yarn docker:tag
$ yarn docker:deploy
https://www.npmjs.com/package/serve
-
Create key pair in EC2 Console
-
Launch EC2 Instance and enable inbound traffic for HTTP
-
Update SSH line in package.json
-
Create ECS Registry and push Docker image up
-
SSH, install Docker:
sudo yum update -y sudo yum install -y docker sudo usermod -a -G docker ec2-user (reboot ec2) sudo service docker start
-
Configure your EC2 instance to pull ECR images using user creds and serve:
aws configure $(aws ecr get-login --no-include-email --region us-west-2) docker pull 791906567261.dkr.ecr.us-west-2.amazonaws.com/parcel-bootstrap-ts:latest docker run -p 80:3000 791906567261.dkr.ecr.us-west-2.amazonaws.com/parcel-bootstrap-ts:latest
Prettier
- Configuration in
.prettierrc
will override editor settings
TSLint
- Rules in
tslint.json
will be used