diff --git a/packages/qwik/src/optimizer/src/plugins/vite-server.ts b/packages/qwik/src/optimizer/src/plugins/vite-server.ts index 0fc78f3b6b1..5d27d7de3e0 100644 --- a/packages/qwik/src/optimizer/src/plugins/vite-server.ts +++ b/packages/qwik/src/optimizer/src/plugins/vite-server.ts @@ -153,7 +153,7 @@ export async function configurePreviewServer( ) { const fs: typeof import('fs') = await sys.dynamicImport('fs'); - const entryPreviewPaths = ['js', 'mjs', 'cjs'].map((ext) => + const entryPreviewPaths = ['mjs', 'cjs', 'js'].map((ext) => path.join(opts.rootDir, 'server', `entry.preview.${ext}`) ); diff --git a/packages/qwik/src/optimizer/src/plugins/vite.ts b/packages/qwik/src/optimizer/src/plugins/vite.ts index 560b26f06ad..ae0a6a5ea5c 100644 --- a/packages/qwik/src/optimizer/src/plugins/vite.ts +++ b/packages/qwik/src/optimizer/src/plugins/vite.ts @@ -433,7 +433,11 @@ export function qwikVite(qwikViteOpts: QwikVitePluginOptions = {}): any { try { const bundleFileName = sys.path.basename(bundeName); const ext = sys.path.extname(bundleFileName); - if (bundleFileName.startsWith('entry.') && (ext === '.mjs' || ext === '.cjs')) { + if ( + bundleFileName.startsWith('entry.') && + !bundleFileName.includes('preview') && + (ext === '.mjs' || ext === '.cjs') + ) { const extlessName = sys.path.basename(bundleFileName, ext); const js = `${extlessName}.js`; const moduleName = extlessName + ext; diff --git a/starters/apps/basic/src/routes/flower/index.tsx b/starters/apps/basic/src/routes/flower/index.tsx index 78174a0457c..4ac5d49fbaa 100644 --- a/starters/apps/basic/src/routes/flower/index.tsx +++ b/starters/apps/basic/src/routes/flower/index.tsx @@ -1,5 +1,5 @@ import { component$, useClientEffect$, useStore, useStylesScoped$ } from '@builder.io/qwik'; -import { useLocation } from '@builder.io/qwik-city'; +import { DocumentHead, useLocation } from '@builder.io/qwik-city'; import styles from './flower.css?inline'; export default component$(() => { @@ -52,3 +52,7 @@ export default component$(() => { ); }); + +export const head: DocumentHead = { + title: 'Qwik Flower', +};