create-app

Why?

I have a few small react projects on the go and keeping their build dependencies up to date individually has become a hassle. I realized that most of my project setups are 95% the same which means I can share configuration to a certain extent.

I was inspired by how create-react-app hides build configuration so cleanly. Although CRA is great, it doesn't fit my goals exactly.

I made create-app to be a multipurpose build tool for myself. The first step I took was to move all build configuration from my react-starter project to create-app and then update the npm/yarn run commands to call create-app commands instead. This also happens to result in an extremely clean package.json file.

Commands

# Run eslint

create-app lint

# Run tests

create-app test

# Format code with prettier

create-app format

# Check if code is properly formatted

create-app format --check

# Run webpack dev server with hot reloading on localhost:8080

create-app dev

# Build for production

create-app build

# Or include a base url path when serving under a specific directory

BASE_URL=react-starter create-app build

# Serve the dist directory on localhost:8080

create-app serve

# Or a different port

create-app serve --port 4000

# Build for production and serve through a docker container on localhost:8080

create-app docker start

# Or a different port

create-app docker start --port 4000

# Create a new react-starter based app

create-app init react my-app

# Or typescript-react-starter

create-app init tsreact my-app

Installation

You really want to use this? It's heavily opinionated and only supports my starter projects... but okay!