-
Notifications
You must be signed in to change notification settings - Fork 227
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
Don't copy devDependencies #90
Comments
It seems that only the packages declared explicitly in devDependencies are excluded. But the dependencies of those packages are not. Since typescript package is a really large one, as a workaround, I add typescript into devDependencies, then the zip size only added 0.1 M with a very simple handler.js But that's not a good solution because once I added more dev packages, their dependencies will go out of control. |
This breaks due to the symlinking, at least on Windows. Serverless runs this command to discover dependencies.
Try running that command in the project's root, then |
Sorry I should include my env. serverless: 1.26.0 |
I'm also seeing this issue on on both my dev box (macOS High Sierra) and in the build container (node:carbon-alpine). Both are using: I'm seeing the same symptoms where |
I'm also seeing this on macOS High Sierra and npm 5.6.0. I've tried npm 6 and yarn and they also behave the same. Are there any plans to review the PR? I'd be happy with the proposed fix to copy instead of symlink. I doubt it would cause any significant performance issues - and regardless would be better to have a fully working build. |
I can get dependencies excluding correctly by downgrading to npm 5.0.4. Anything higher and only top level is excluded.
|
I really need this issue fixed. I see that there are several pull requests to fix this. May we have them merged? Thank you! |
FYI - I've switched to use serverless-webpack with ts-loader and works well |
This issue still persists. Just curious: Is there a reason this does not get worked on? |
Hi @Junkern, it's just me maintaining this in my spare time and I'm looking into another issue right now. If this is continuing to be a problem for many I'll prioritise this when I can. Am I correct in assuming that this issue does not block deployments/packaging? |
@JackCuthbert That's for maintaining this. To answer your question about blocking deployments, depending on the size of the project, it can be a blocker. For our project, we ended up having to write some custom code to trim dev dependencies to allow the project bundle to stay within the 50mb lambda limit. |
For me, it does not block. But as @ajmath explained it can be a blocker. Also having a larger bundle increases deploymen times, startup times and so on... Would you prefer me doing a PR and fixing this? (e.g. https://github.com/prisma/serverless-plugin-typescript/pull/101/files) |
@JackCuthbert Here is what I did for the workaround https://gist.github.com/ajmath/db7a1210cf9e01403e3dfb6004c1b89a |
@ajmath that works perfectly, thanks! |
🎉 This issue has been resolved in version 1.1.8 🎉 The release is available on: Your semantic-release bot 📦🚀 |
there is an issue about this problem but it's closed.
#13
Some other ppl and I still have the problem in that issue. So just to reopen it here.
package.json
serverless-plugin-typescript is not in the final release, but typescript and the dependencies of typescript do.
I tried not to include serverless-plugin-typescript plugin in serverless.yml (it's still installed and exist in package.json), the node_modules in zip file will only have aws-sdk and its dependencies.
The text was updated successfully, but these errors were encountered: