Skip to content

Commit

Permalink
feat(vite): allow disabling dev SSR server in vite (#5347)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhevery authored Oct 23, 2023
1 parent fceb57d commit 8778981
Showing 1 changed file with 15 additions and 1 deletion.
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

0 comments on commit 8778981

Please sign in to comment.