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

do not include api server plugin for production builds #275

Merged
merged 5 commits into from
Oct 22, 2021

Conversation

ryanatkn
Copy link
Owner

@ryanatkn ryanatkn commented Oct 22, 2021

This changes the default config to not add the API server plugin for production builds. This may be needed for some usecases like prerendering, but for SvelteKit apps using @sveltejs/adapter-node's middleware, running the server in production doesn't work because the middleware hasn't been built yet.

Also cleans up the SvelteKit Node build a bit in the Gro adapter, removing unused files. The SvelteKit Node adapter is not configurable to choose between middleware and a standalone server, so the Gro adapter supports the deploymentMode option that defaults to middleware, signalling Gro to delete the Node adapter's index.js output and keep middlewares.js, and vice versa when server. The both option deletes nothing.

@ryanatkn ryanatkn changed the title run api server only during development add api server plugin only during development Oct 22, 2021
@ryanatkn ryanatkn changed the title add api server plugin only during development do not include api server plugin for production builds Oct 22, 2021
@ryanatkn ryanatkn merged commit 1d7a1b1 into main Oct 22, 2021
@ryanatkn ryanatkn deleted the api-server-build branch October 22, 2021 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant