Skip to main content

Example application

The repository includes two React + TypeScript examples that serve as integration tests and copyable starters:

What it exercises

FeatureHow
TypeScript + TSXsrc/index.tsx, src/App.tsx, Webpack ts-loader/ForkTsChecker or Vite/esbuild
React + hooksuseState in App.tsx
SCSSindex.scss, App.scss
Static assetsSVG import
@root alias@root/App, @root/assets/logo.svg
ESLint flat configrecommended + typescript overlays
HTMLWebpack template or Vite index.html entry
Production buildbuild:prod in CI

Not covered: custom publicPath, dev-server proxy, or library/UMD builds. See Webpack configuration and Vite configuration.

Run inside the monorepo

From the repository root:

nvm use
yarn install
yarn workspace my-app start
yarn workspace my-app lint
yarn workspace my-app build:prod
yarn workspace my-vite-app start
yarn workspace my-vite-app lint
yarn workspace my-vite-app build:prod

Use as a starter template

  1. Copy examples/typescript or examples/typescript-vite outside the monorepo.
  2. In package.json, replace the workspace dependency:
"devDependencies": {
"@ekz/packer": "beta",
"typescript": "^6.0.3"
}
  1. In tsconfig.json, set extends to ./node_modules/@ekz/packer/tsconfig/recommended.json and add @root paths (see ESLint).
  2. Run nvm use, yarn install, and yarn start.

Included files

FilePurpose
webpack.config.jsWebpack createApplicationConfiguration() with custom HTML template
vite.config.jsVite createApplicationConfiguration()
eslint.config.jsFlat config from @ekz/packer/recommended and /typescript
tsconfig.jsonExtends @ekz/packer/tsconfig/recommended
src/TSX entry, component, SCSS, static asset
public/ or index.htmlWebpack HTML template or Vite HTML entry