Back to Skaffold

README

examples/typescript/README.md

2.19.01.2 KB
Original Source

Example: TypeScript + Node.js with hot-reload

Seeks to be functionally identical to the Node.js example, except with TypeScript.

Swaps nodemon for tsc-watch

Init

bash
skaffold dev

Workflow

  • Make some changes to index.ts:
    • The file will be synchronized to the cluster
    • tsc-watch will restart the application
  • Make some changes to package.json:
    • The full build/push/deploy process will be triggered, fetching dependencies from npm
  • NOTE: Currently in this example, tsc-watch is not configured when ENV=production. To configure it, update the package.json file scripts.production" field to be:
    • "production": "tsc && node ./src/index.js" instead of the default "production": "node src/index.js",