- React + Preact(as compatibility layer)
- Redux + Redux Tool Kit
- Typescript
- GraphQL
- Webpack
- PNPM
- Cypress
- Run application before e2e using start-server-and-test
- Generate coverage report
- Github Actions
- Build
- Unit tests
- e2e tests
- Coverage
- Deploy
- Husky
- Pre-commit(lint + format)
pnpm start
pnpm build
pnpm format
pnpm lint
pnpm unit
pnpm e2e
pnpm build:analyze
Generated via BundleAnalyzerPlugin
Chunk | Size |
---|---|
All | 1.44 MB |
vendors.js | 1.39 MB |
main.js | 50.35 KB |
runtime.js | 1.49 KB |
Chunk | Size |
---|---|
All | 462.61 KB |
vendors.js | 441.9 KB |
main.js | 19.22 KB |
runtime.js | 1.49 KB |
Chunk | Size |
---|---|
All | 147.12 KB |
vendors.js | 140.25 KB |
main.js | 6.08 KB |
runtime.js | 802 B |
Cypress requires independent configuration for some tools. For example, we dont need to use full webpack config for tests and we need to include cypress types for typescript.
Since(for this moment) kit uses swc-loader we also need to copy .swcrc
file from root to the cypress folder.
In the future there is could be the way to set path for .swcrc and use root config.
I decided to focus on the tools and their configs. If you need to add some loaders or plugins feel free to customize webpack.config. For example you may want to add favicon-webpack-plugin. This plugin could generate different sets of favicons for you.
I'm using concepts from feature-sliced architecture. You could delete or replace content from src
folder and use your own naming strategy or architecture. I like short paths in imports and index.ts + ts-paths works perfect for me.
Also check out atomic-design pattern.
With Preact you could use all of React features with smaller bundle size. Thanks to preact/compat all we need to do is create aliases for webpack and use preact/compat instead of React. According to Preact website:
preact/compat is our compatibility layer that allows you to leverage the many libraries of the React ecosystem and use them with Preact.
Using this "compatibility layer", we combine a small bundle size(~100kb diff for demo app) with full support for all React ecosystem libraries such as: react-redux, react-router, etc.