Build and Tooling Skills – DynamoHome
Bundler: Webpack 5
webpack.config.ts is the single source of truth for all bundling.
Key configuration
Entry: src/index.tsx
Output: dist/build/index.bundle.js ← path is hardcoded in Dynamo, do NOT change
Loaders: ts-loader (TS/TSX), babel-loader (JS/JSX), css-loader + style-loader (CSS)
Plugins: HtmlWebpackPlugin → dist/build/index.html
Modes: development (unminified) | production (TerserPlugin minification)
Build commands
npm run start # webpack-dev-server, port 8080, hot reload
npm run build # dev bundle (webpack --mode=development)
npm run bundle # production bundle (webpack --mode=production, minified)
npm run production # bundle + copy package.json, README.md, license_output → dist/
TypeScript: tsconfig.json
Critical settings to preserve:
"strict": false — enabling this breaks existing code; do not change without explicit user approval
"resolveJsonModule": true — required for import messages from './locales/en.json'
"typeRoots": ["./types", "./node_modules/@types"] — custom types loaded from types/index.d.ts
"jsx": "react-jsx" — no need for import React from 'react' in components
ESLint: .eslintrc
- Extends
react-app preset
- Covers
src/ and tests/
- Run:
npm run lint:check (read-only), npm run lint:fix (auto-fix)
- Must pass before any PR merge
Jest: jest.config.ts
- Preset:
ts-jest
- Environment:
jsdom
- Coverage from:
src/**/*.{ts,tsx}, output to ./coverage/
- Setup file:
tests/jest.setup.ts — applies chrome global mocks
- Module name mapper: CSS →
identity-obj-proxy, images → fileMock.ts
- Unit test files live in:
tests/unit/
- Run:
npm run test:unit
Playwright: playwright.config.js
- Chromium only
testDir: './tests/e2e' — scoped to e2e tests only
- Web server: auto-starts
npm start before tests, waits for port 8080
- CI: 1 worker, 2 retries; local: unlimited workers, 0 retries
- Run:
npm run test:e2e (targets all *.spec.ts files in tests/e2e/)
When making build changes
- After
webpack.config.ts changes: verify npm run build AND npm run bundle both succeed
- After
tsconfig.json changes: verify npm run lint:check and npm run test:unit pass
- After
package.json script changes: verify all affected scripts still work
- After adding a new webpack loader: verify CSS Modules still work (
identity-obj-proxy in tests), and that the production build minifies correctly
- After CI changes (
.github/workflows/): review that build.yml triggers correctly on PR and push
What NOT to do
- Do not switch to Vite, Rollup, esbuild, or Parcel
- Do not change the output path
dist/build/ — Dynamo integration depends on it
- Do not enable
strict: true in tsconfig.json
- Do not rename existing npm scripts — CI pipelines call them by name
- Do not add loaders or plugins for technologies not used in the project (e.g., SASS, Less, SVGR) without explicit approval
- Do not modify
jest.setup.ts or the mock files in tests/__mocks__/ without understanding downstream impact
1---2name: build-tooling3description: Build and Tooling Skills – DynamoHome4---5# Build and Tooling Skills – DynamoHome67## Bundler: Webpack 589`webpack.config.ts` is the single source of truth for all bundling.1011### Key configuration1213```14Entry: src/index.tsx15Output: dist/build/index.bundle.js ← path is hardcoded in Dynamo, do NOT change16Loaders: ts-loader (TS/TSX), babel-loader (JS/JSX), css-loader + style-loader (CSS)17Plugins: HtmlWebpackPlugin → dist/build/index.html18Modes: development (unminified) | production (TerserPlugin minification)19```2021### Build commands2223```bash24npm run start # webpack-dev-server, port 8080, hot reload25npm run build # dev bundle (webpack --mode=development)26npm run bundle # production bundle (webpack --mode=production, minified)27npm run production # bundle + copy package.json, README.md, license_output → dist/28```2930## TypeScript: tsconfig.json3132Critical settings to preserve:33- `"strict": false` — enabling this breaks existing code; do not change without explicit user approval34- `"resolveJsonModule": true` — required for `import messages from './locales/en.json'`35- `"typeRoots": ["./types", "./node_modules/@types"]` — custom types loaded from `types/index.d.ts`36- `"jsx": "react-jsx"` — no need for `import React from 'react'` in components3738## ESLint: .eslintrc3940- Extends `react-app` preset41- Covers `src/` and `tests/`42- Run: `npm run lint:check` (read-only), `npm run lint:fix` (auto-fix)43- Must pass before any PR merge4445## Jest: jest.config.ts4647- Preset: `ts-jest`48- Environment: `jsdom`49- Coverage from: `src/**/*.{ts,tsx}`, output to `./coverage/`50- Setup file: `tests/jest.setup.ts` — applies chrome global mocks51- Module name mapper: CSS → `identity-obj-proxy`, images → `fileMock.ts`52- Unit test files live in: `tests/unit/`53- Run: `npm run test:unit`5455## Playwright: playwright.config.js5657- Chromium only58- `testDir: './tests/e2e'` — scoped to e2e tests only59- Web server: auto-starts `npm start` before tests, waits for port 808060- CI: 1 worker, 2 retries; local: unlimited workers, 0 retries61- Run: `npm run test:e2e` (targets all `*.spec.ts` files in `tests/e2e/`)6263## When making build changes64651. After `webpack.config.ts` changes: verify `npm run build` AND `npm run bundle` both succeed662. After `tsconfig.json` changes: verify `npm run lint:check` and `npm run test:unit` pass673. After `package.json` script changes: verify all affected scripts still work684. After adding a new webpack loader: verify CSS Modules still work (`identity-obj-proxy` in tests), and that the production build minifies correctly695. After CI changes (`.github/workflows/`): review that `build.yml` triggers correctly on PR and push7071## What NOT to do7273- Do not switch to Vite, Rollup, esbuild, or Parcel74- Do not change the output path `dist/build/` — Dynamo integration depends on it75- Do not enable `strict: true` in `tsconfig.json`76- Do not rename existing npm scripts — CI pipelines call them by name77- Do not add loaders or plugins for technologies not used in the project (e.g., SASS, Less, SVGR) without explicit approval78- Do not modify `jest.setup.ts` or the mock files in `tests/__mocks__/` without understanding downstream impact