GPTRouter icon indicating copy to clipboard operation
GPTRouter copied to clipboard

usage of `ts-node` and `--watch` in production adds higher memory footprint

Open unownone opened this issue 1 year ago • 0 comments

Summary

Both Dockerfile and Dockerfile.ECS.Alpha refer to using npm start which in turn executes this script:

  "scripts": {
    "build": "tsc -p tsconfig.json",
    "start": "nodemon --watch 'src/**/*.ts' --exec 'ts-node' src/index.ts"
  }

Here, usage of both --watch and ts-node add extra overhead as there should be no requirement of ts-node and or watch.

As per this thread How to use ts-node in production, we should either use --transpile-only or even better have a prebuild step that precompiles all the typescript code into javascript. This will reduce the extra overhead ts-node and watch adds.

unownone avatar Dec 14 '23 06:12 unownone