Example application
The repository includes two React + TypeScript examples that serve as integration tests and copyable starters:
examples/typescriptfor Webpackexamples/typescript-vitefor Vite
What it exercises
| Feature | How |
|---|---|
| TypeScript + TSX | src/index.tsx, src/App.tsx, Webpack ts-loader/ForkTsChecker or Vite/esbuild |
| React + hooks | useState in App.tsx |
| SCSS | index.scss, App.scss |
| Static assets | SVG import |
@root alias | @root/App, @root/assets/logo.svg |
| ESLint flat config | recommended + typescript overlays |
| HTML | Webpack template or Vite index.html entry |
| Production build | build: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
- Copy
examples/typescriptorexamples/typescript-viteoutside the monorepo. - In
package.json, replace the workspace dependency:
"devDependencies": {
"@ekz/packer": "beta",
"typescript": "^6.0.3"
}
- In
tsconfig.json, setextendsto./node_modules/@ekz/packer/tsconfig/recommended.jsonand add@rootpaths (see ESLint). - Run
nvm use,yarn install, andyarn start.
Included files
| File | Purpose |
|---|---|
webpack.config.js | Webpack createApplicationConfiguration() with custom HTML template |
vite.config.js | Vite createApplicationConfiguration() |
eslint.config.js | Flat config from @ekz/packer/recommended and /typescript |
tsconfig.json | Extends @ekz/packer/tsconfig/recommended |
src/ | TSX entry, component, SCSS, static asset |
public/ or index.html | Webpack HTML template or Vite HTML entry |