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 dependency (70MB) is installed athough not really used by package #423

Closed
medikoo opened this issue Apr 30, 2020 · 2 comments · Fixed by #453
Closed

TypeScript dependency (70MB) is installed athough not really used by package #423

medikoo opened this issue Apr 30, 2020 · 2 comments · Fixed by #453
Assignees
Labels
bug Something isn't working

Comments

@medikoo
Copy link
Contributor

medikoo commented Apr 30, 2020

Originally reported at serverless/serverless#7640

It attributes to way heavier (+70MB) Framework installation, and heavier standalone size (+30MB)

Regression was introduced with #375, which taken on board dependency-tree dependency which lists TypeScript as its prod dependency.

We probably should find some alternative for dependency-tree

@stevewillard
Copy link

Hmm... ok here is kind of a crazy idea:

What if we installed the enterprise-plugin (not the SDK, but the CLI command dependencies themselves) to another folder instead of node_modules. I'm not totally clear of the logistics around making that possible, and it would probably make development on the plugin more annoying since all the require paths would be relative (unless we somehow modified the NODE_PATH).

Anyways, the reason I'm throwing this idea out there is because it seems silly that node_modules, strictly necessary for the CLI, are getting bundled with functions. We can look for an alternative to dependency-tree, but I think the core issue is unnecessary dependencies are getting bundled.

@medikoo
Copy link
Contributor Author

medikoo commented May 1, 2020

@stevewillard moving our dependencies around, wouldn't reduce project and binary size

Source of the issue is, that we've started to bundle/install TypeScript which is not needed and not used by the by project, and we need to recover from that.

I believe it's actually a bug on dependency-tree side that it unconditionally requires typescript.
I've opened a dedicated issue over there: dependents/node-dependency-tree#117

If they wouldn't want to opt-out, we would need to find some alternative, e.g. we can use https://github.com/medikoo/ncjsm#getdependeciesmodulepath-options---ignoremissing-false- which I believe would also be faster, I will just have to introduce an option to not resolve external (from node_modules) depenencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants