A template for React web applications
This template is configured with the latest LTS version of Node (v14).
Use npm start
to start the dev server.
Use npm run build
to create production build.
build
folder.babel.config.json
.src/app.tsx
.@babel/polyfill
. Custom polyfills can be added in src/polyfill.js
.module.rules
in webpack.common.js
.webpack.common.js
(shared config)webpack.dev.js
webpack.prod.js
HtmlWebpackPlugin
: Uses src/index.html
as the main entrypoint for the project.
DefinePlugin
: Defines the following environment variables:
Variable | default value | Notes |
---|---|---|
ENV |
test , development , production |
The value is set automatically based on the running environment |
PUBLIC_PATH |
/ |
The context that the app is running in (e.g. /app if the app is accessible at https://<domain>/app ). It can be set via PUBLIC_PATH environment variable and must end with a slash. |
FaviconsWebpackPlugin
: Generates favorite icons from the image in src/images/favicon.png
.
MiniCssExtractPlugin
: Extracts the styling from JS files into css files.
CleanWebpackPlugin
: Removes and cleans up the build folder before a new build.
BundleAnalyzerPlugin
: Provides information and analytics on the generated bundle. It can be accessed on localhost:8081
and is only available in development mode.
tsconfig.json
for customized features.src/types/index.d.ts
.Use npm run lint
to see a list of linting issues.
Use npm run lint:fix
to fix those issues that can be handled automatically.
.prettierrc
for Prettier configs..eslintrc
for Eslint configs and .eslintignore
for the ignored patterns.Use npm run test
to run the test units.
Use npm run test:watch
to start the test runner in watch mode.
jest.config.js
for customized features.coverage
flag to report code coverage.**/__tests__/**/*.[jt]s?(x)
**/?(*.)+(spec|test).[tj]s?(x)
Use npm run docs
to generate docs.
typedoc.json
.docs
folder..huskyrc
and .lintstagedrc
. The only check is eslint
rules.The repo has one Github workflow that checks the linting rules and runs the tests (see .github/workflows/test.yaml
).
There are issue and PR templates in .github
.