Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
unownone opened this issue Dec 14, 2023 · 0 comments
Open

Comments

@unownone
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant