A starter frontend boilerplate built with:
This also uses lint-staged for running pre-commit checks.
- Support for both TypeScript and JavaScript as needed.
- Loads environment variables via
.envfile. - May be extended to be used with React, Vue.js, or Angular.
- Minification of TypeScript/JavaScript and CSS processed files.
- Assets optimization.
- Webpack Dev Server plugin for local development.
- Webpack Bundle Analyzer for visualising script output and usage.
- CI workflow.
src └── css │ ├── all │ └── styles.css ├── index.ts public ├── assets ├── favicon.ico └── index.html - src
- The entry typescript file is index.ts.
- The helpers/set-message folder is a sample folder for how to test using Jest.
- Local files are imported using the
'@/'alias. See index.ts file for example.
- scr/css
- Add your styles here and
@importthem to the entry styles.css file.
- Add your styles here and
- public
- Edit the index.html in the public folder to suite your needs.
- Replace the favicon.ico with your own icon.
- public/assets.
- Add your assets, to the assets folder.
You may change the configuration for Webpack within the webpack folder.
You may set the following in your .env for setting up your project (default values shown).
PORT_NUMBER=9000 HOST_NAME=localhost TITLE=TypeScript Webpack BoilerplateRun:
yarn installRun:
yarn serveThis will create a server at http://localhost:9000/ or server data specified in your .env file.
Automatically reloads after each file change.
Run:
yarn buildWill output all build files into the dist folder.
Run:
yarn testor watch files
yarn test:watchRun:
yarn lintTo fix all possible errors automatically run:
yarn lint:fixRun:
yarn lint:check-typesThere is no automatic fix option for TypeScript.
Run:
yarn lint:scriptsTo fix all possible errors automatically run:
yarn lint:scripts:fixRun:
yarn lint:stylesTo fix all possible errors automatically run:
yarn lint:styles:fixRun:
yarn check-sizeThis will create a server at http://localhost:8888/ or at the port number specified using the -p or --port option via the cli.