Closed lolcabanon closed 5 months ago
I'm curious why you installed it as a dev dependency?
as per: https://kit.svelte.dev/docs/adapter-node#deploying
Development dependencies will be bundled into your app using Rollup. To control whether a given package is bundled or externalised, place it in devDependencies or dependencies respectively in your package.json.
I'm curious why you installed it as a dev dependency?
Since SvelteKit bundle the app, most dependencies are in fact devDependencies.
The prod app can be executed by copying the build directory only without npm install
if there are no actual runtime specific or impossible to bundle dependencies (as oslo
seems to be). (I also have dotenv
for my loader script and one other I can't remember, but all the other deps are devDependencies.)
In my case I only run npm install --prod
so it is much faster and lighter like this.
I tought this was the way for SvelteKit lol am I doin this wrong?
Ah, makes sense TIL. I think we can remove the optimizeDeps
from the docs then
I'll review the PR with relevant infos!
Might be better to just add a warning to the install step? Something like "Oslo must be installed as a regular dependency, not a dev dependency."
Updated both sections. Let me know what you think of it!
Also thanks @ollema for the documentation link. :smiley:
Thanks!
My pleasure! Thanks for the update to v3! The migration went smooth (except when I tried to build lol!) :smile:
Added specific configuration example for Svelte/Kit
I am not sure exactly what to include, since I tested only for
sveltekit
withadapter-node
specifically.I couldn't
build
successfully until I movedoslo
fromdevDependencies
todependencies
. I tried withoptimizeDeps: { exclude: ["oslo"] }
before, but it did not solve my issue. Thevite build
process could succeed, but then the@sveltejs/adapter-node
step would fail.Here's the stack in case someone have the same problem :