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

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

Open
acomagu opened this issue Dec 4, 2021 · 0 comments

Comments

@acomagu
Copy link

acomagu commented Dec 4, 2021

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.

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