Skip to content

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

Description

@unownone

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions