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

[question] deno bundle deprecated - deno compile and a different approach? #268

Open
GeoffWilliams opened this issue Apr 5, 2024 · 0 comments

Comments

@GeoffWilliams
Copy link

I have been trying to publish a deno lambda and noticed during build I was getting warning:

⚠️ Warning: `deno bundle` is deprecated and will be removed in Deno 2.0.
Use an alternative bundler like "deno_emit", "esbuild" or "rollup" instead.

This led me to denoland/deno#11073 and I found out deno compile can be used to build a static executable containing the deno runtime and all app codes and dependencies.

Since this repo takes the approach to run the deno command directly I don't think the using compile will work. AWS allows a file bootstrap to be executed automatically so I wonder if a simpler technique compatible with future deno roadmap is to just use deno compile to produce bootstrap, and then have user code import the event loop as a module and then copy and paste a main function?

I was able to make this approach work and have a hello world example that can be deployed with terraform. The entrypoint for user code is app.ts and the event loop is in lambda.ts: https://github.com/GeoffWilliams/deno-lambda-terraform

Is this heading in the right direction? If so is there scope to include in this repo?

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