diff --git a/packages/plugin-preview/src/index.ts b/packages/plugin-preview/src/index.ts index 7a1ea957e..67f7e40d9 100644 --- a/packages/plugin-preview/src/index.ts +++ b/packages/plugin-preview/src/index.ts @@ -38,7 +38,7 @@ export function pluginPreview(options?: Options): RspressPlugin { previewCodeTransform = ({ code }: { code: string }) => code, } = options ?? {}; const previewMode = - (options?.previewMode ?? isMobile) ? 'iframe' : 'internal'; + options?.previewMode ?? (isMobile ? 'iframe' : 'internal'); const { devPort = 7890, framework = 'react',