-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Using sequence
means I need to include @sveltejs/kit
in my Node Docker image
#3709
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
Comments
This sounds like it's essentially the same as #3176. |
Almost entirely (I didn't see it when searching). It would solve this, but I guess it is possible to solve this without also solving #3176 (this is essentially a narrower issue I encountered while working around that issue). |
https://kit.svelte.dev/docs#modules-sveltejs-kit-hooks is an anomaly in that it's the only SvelteKit-provided module that stays in your |
I don't think that would be the correct fix, because I think the correct fix would be to address #3176 and not force people to do that in userland. Dev dependencies of your app shouldn't be required in production, and the build should take that into account when bundling stuff. Moving this into |
I checked quickly and what Moving |
I ran into this issue today. I've for now moved my |
Going to close this in favour of #3176, as the solution to that would cover this issue. I don't think there's much mileage in applying a narrower fix here (though now that I think about it, |
Uh oh!
There was an error while loading. Please reload this page.
Describe the problem
I noticed when trying to slim down my Docker images that if I kept only the runtime dependencies after building (which I list in
dependencies
and install withnpm ci --only=prod
) my container would immediately crash because itCannot find package '@sveltejs/kit' imported from /usr/srv/build/server/app.js
.It turns out that when you use
sequence()
for hooks, the generatedapp.js
file includesimport { sequence } from '@sveltejs/kit/hooks
.Describe the proposed solution
I'm not sure how, but it would be nice if we copied over the relevant code (the 26 lines from https://github.com/sveltejs/kit/blob/master/packages/kit/src/hooks.js) in the build or something so I don't have to include the entirety of SvelteKit in my runtime.
Not sure if this is Kit or the adapter.
Alternatives considered
I can just live with it. It's just ~2MB of the total image size.
Importance
nice to have
Additional Information
No response
The text was updated successfully, but these errors were encountered: