A batteries-included template for Cloudflare Workers with the following configuration:
- Sunder minimal web framework.
- ESBuild for builds in <50ms.
- Typescript for typechecking.
- Miniflare and Jest for testing.
- Sass for CSS preprocessing and minification.
- Workers Sites for static files.
If you disagree with any of these choices it's easy to swap out that decision.
Press the green "Use this template" button in the top right to make a Github repository based on this one.
To build and preview using Miniflare, use
npm run miniflare
To serve using Miniflare, watch changes and build as you make changes, use
npm run watch
To make a production build use
npm run build
The tests are run using Jest. Use npm test
to run your tests.
This is the recommended way to develop most of your app. Write tests for core functionality instead of relying on Miniflare or wrangler dev
.
To publish, first make a build using npm run build
and then use the Wrangler CLI tool.