Skip to content

typescript-is introduces "typescript" dependency into production environment #119

@acomagu

Description

@acomagu

typescript-is depends on typescript package indirectly, so typescript compiler is installed whenever we use typescript-is, even if in production environment.

typescript package has a size of 64MB. This is too big to ignore(e.g. The limit of AWS Lambda asset is 250MB)

Reproduction

package.json:

{
  "dependencies": {
    "express": "^4.17.1",
    "typescript-is": "^0.19.0"
  },
  "devDependencies": {
    "@types/express": "^4.17.13",
    "ttypescript": "^1.5.12",
    "typescript": "^4.5.2"
  }
}

Then, NODE_ENV=production npm i installs typescript.

npm why:

$ npm why typescript
[email protected]
node_modules/typescript
  dev typescript@"^4.5.2" from the root project
  peer typescript@">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta"
from [email protected]
  node_modules/tsutils
    tsutils@"^3.17.1" from [email protected]
    node_modules/typescript-is
      typescript-is@"^0.19.0" from the root project
  peer typescript@"^4.1.5" from [email protected]
  node_modules/typescript-is
    typescript-is@"^0.19.0" from the root project

p.s. Thank you for awesome project! I'm using this to validate the API Request/Response, DB entity, and so on in production environment. I really love this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions