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

npm run dev should have an option to output build files #3581

Closed
thequailman opened this issue Jan 28, 2022 · 2 comments
Closed

npm run dev should have an option to output build files #3581

thequailman opened this issue Jan 28, 2022 · 2 comments
Labels
feature / enhancement New feature or request vite wontfix This will not be worked on

Comments

@thequailman
Copy link

thequailman commented Jan 28, 2022

Describe the problem

When developing my frontend code, I like having my backend serve the dev assets like in production. In webpack, I can do this by configuring the middleware settings. This helps because I can use relative paths from the frontend to the backend, i.e. /api.

Describe the proposed solution

I believe SvelteKit just needs to honor the config "vite.server.middlewareMode = ssr" in svelte.config.js. Though #2232 make this seem like it may be harder to do.

Alternatives considered

I could try doing HTTP proxying from my backend to the frontend, it's just a pain to wire up.

Importance

would make my life easier

Additional Information

No response

@Conduitry
Copy link
Member

I don't know how this would work, since one of the core ideas of Vite's dev mode is that pretty much everything is only transformed on-demand when a page you visit needs it.

The middlewareMode setting doesn't seem related to this as far as I can tell.

I would recommend a proxy solution instead.

@bluwy bluwy added feature / enhancement New feature or request vite labels Jan 29, 2022
@bluwy
Copy link
Member

bluwy commented Jan 29, 2022

I don't see this being possible either. One of the reason Vite is fast is because it doesn't rely on the filesystem for dev mode and keep things in memory. A lot of stuff happens in memory and today it's not really possible to serialize them into the filesystem, and to be run separately via a node server for example. Adding in adapters, it sounds like it would open a can of worms. Hence, I don't think this is something worth pursuing at the moment.

@bluwy bluwy closed this as completed Jan 29, 2022
@bluwy bluwy added the wontfix This will not be worked on label Jan 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature / enhancement New feature or request vite wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants