How to run a Sveltekit project from another directory? #7717
Unanswered
alexbjorlig
asked this question in
Q&A
Replies: 2 comments
-
im not sure if its possible to start the dev server from another directory but I know if you are using adapter-node you can build the app and use sveltekit as an express middleware by importing handler.js from the build dir |
Beta Was this translation helpful? Give feedback.
0 replies
-
i am facing the same problem, we have several packages in our monorepo (electron application) and I wanted to experiment with sveltekit, but I am facing the problem where I cannot create a vite server from the root of the repo. > const vite = require("vite");
> const server = await vite.createServer({configFile: "packages/renderer.experimental/vite.config.ts" });
The following Vite config options will be overridden by SvelteKit:
- root
src\app.html does not exist
undefined
> await server.listen() Then on the browser I am getting the same error as mention above
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to run the vite devserver from another directory.
Essentially
npm create svelte@latest my-app
cd my-app
npm i
cd .. && npx vite dev my-app
This starts the vite dev server, with a couple of warnings:
When I try to visit port 5173 in the browser, I also get an error:
What is going on here - is it impossible to start the Sveltkit server from another directory?
(The underlying reason for this is that we have a mono-repo, and I would like some of our e2e and integration tests to live in another package. But it seems like I might have to re-think that now 😅 )
Beta Was this translation helpful? Give feedback.
All reactions