Rouffy
Rouffy
DDeno
Created by Rouffy on 12/23/2024 in #help
[Svelte + Vite + Deno 2.0] Svelte and Vite configuration without a package.json
Hello, i am trying to setup a deno 2.0 simple project that has svelte (not svelte kit) and vite on it as well as rely only on a deno.json file for the dependency installation instead of package.json. My current situation is, i have the project setup with the needed dependencies inside of the deno.json and i have the vite.config.ts, svelte.config.ts and tsconfig.json setup as well. Initially the project works just fine when you run it with just vite, but when i try to add a Svelte component like the usual App.svelte i am being hit with this vite error Pre-transform error: Failed to resolve import "svelte/internal/disclose-version" from "src/App.svelte". Does the file exist?. I am pretty sure that the root cause for this is the fact that the modules with deno 2.0 and deno.json are being installed in a diffrent directory for me on Linux that's .cache/deno, the file mentioned in the vite error is present in the svelte module folder that is in .cache/deno/npm/registry.npmjs.org/svelte/5.15.0/src/internal/. I am not sure what i am supposed to do to make vite look into that path to fetch the file it needs. Thanks in advance for any responses
8 replies