cra-template-stocky37

CRA template that includes some opinionated best practices.

Usage no npm install needed!

<script type="module">
  import craTemplateStocky37 from 'https://cdn.skypack.dev/cra-template-stocky37';
</script>

README

cra-templates

Packages

  • cra-template scripts
  • template-stocky37
    • cra-template-stocky37 (generated)

Scripts

build:fresh

As build fails if run when the generated template workspaces do not exist yet, this script aims to run a build that should always succeed.

Templates

cra-template-stocky37

This is my own personal template and includes the following on top of the base cra-template:

  • react-router v6 for routing
  • react-query for fetching data
  • json-server for mocking JSON APIs locally
  • allow absolute imports from the src directory
  • Dockerfiles for both development and production use
  • can pull envvars from window.env (set in /config.js) or process.env
  • eslint configured with airbnb base and sane defaults
  • prettier configured with my own preferred configuration
  • pretty-package-json configured with defaults for keeping package.jsons prettified and deterministically ordered
  • husky & lint-staged configured to run eslint, prettier and pretty-package-json in a pre-commit hook
  • @welldone-software/why-did-you-render for helping debug rerender issues in development