Skip to content

Commit 6815f22

Browse files
authored
fix: test mode force isServer=true (#4056)
fixed #4034
1 parent faf7b6b commit 6815f22

File tree

1 file changed

+3
-3
lines changed
  • packages/qwik/src/optimizer/src/plugins

1 file changed

+3
-3
lines changed

packages/qwik/src/optimizer/src/plugins/plugin.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ export function createPlugin(optimizerOptions: OptimizerOptions = {}) {
481481
log(`load()`, QWIK_BUILD_ID, opts.buildMode);
482482
return {
483483
moduleSideEffects: false,
484-
code: getQwikBuildModule(loadOpts),
484+
code: getQwikBuildModule(loadOpts, opts.target),
485485
};
486486
}
487487

@@ -749,8 +749,8 @@ export function createPlugin(optimizerOptions: OptimizerOptions = {}) {
749749
return id;
750750
};
751751

752-
function getQwikBuildModule(loadOpts: { ssr?: boolean }) {
753-
const isServer = !!loadOpts.ssr;
752+
function getQwikBuildModule(loadOpts: { ssr?: boolean }, target: QwikBuildTarget) {
753+
const isServer = !!loadOpts.ssr || target === 'test';
754754
const isDev = opts.buildMode === 'development';
755755
return `// @builder.io/qwik/build
756756
export const isServer = ${JSON.stringify(isServer)};

0 commit comments

Comments
 (0)