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

feat(vite): allow disabling dev SSR server in vite #5347

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion packages/qwik/src/optimizer/src/plugins/vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,8 @@ export function qwikVite(qwikViteOpts: QwikVitePluginOptions = {}): any {

configureServer(server: ViteDevServer) {
server.middlewares.use(getImageSizeServer(qwikPlugin.getSys(), rootDir!, srcDir!));
if (!qwikViteOpts.csr) {
const devSsrServer = 'devSsrServer' in qwikViteOpts ? qwikViteOpts.devSsrServer : true;
if (!qwikViteOpts.csr && devSsrServer) {
const plugin = async () => {
const opts = qwikPlugin.getOptions();
const sys = qwikPlugin.getSys();
Expand Down Expand Up @@ -832,6 +833,19 @@ interface QwikVitePluginSSROptions extends QwikVitePluginCommonOptions {
*/
manifestOutput?: (manifest: QwikManifest) => Promise<void> | void;
};

/**
* Qwik is SSR first framework. This means that Qwik requires either SSR or SSG. In dev mode the
* dev SSR server is responsible for rendering and pausing the application on the server.
*
* Under normal circumstances this should be on, unless you have your own SSR server which you
* would like to use instead and wish to disable this one.
*
* Default: true
*/
devSsrServer?: boolean;

/** Controls the SSR behavior. */
ssr?: {
/**
* The entry point for the SSR renderer. This file should export a `render()` function. This
Expand Down