Skip to content
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
4 changes: 3 additions & 1 deletion scripts/test-vinext-pages.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ for (const deployment of deployments) for (const reference of [true, false]) {
await writeFile(join(cwd, 'next.config.mjs'), `export default ${JSON.stringify({ reactStrictMode: true, basePath, trailingSlash: !!basePath, ...(deployment === 'standalone' ? { output: 'standalone' } : staticExport ? { output: 'export' } : {}) })}\n`)
if (workers) await cp(join(consumer, 'wrangler.jsonc'), join(cwd, 'wrangler.jsonc'))
const config = join(cwd, 'vite.config.mjs')
await writeFile(config, `import { defineConfig } from 'vite'\nimport vinext from 'vinext'\nimport { redact } from '@tanstack/redact/vinext'\nimport { cloudflare } from '@tanstack/redact/cloudflare'\nexport default defineConfig({ root: ${JSON.stringify(cwd)}, cacheDir: ${JSON.stringify(join(cwd, '.vite'))}, plugins: [vinext({appDir:${JSON.stringify(cwd)}}), ${workers ? `await cloudflare({configPath:${JSON.stringify(join(cwd, 'wrangler.jsonc'))},viteEnvironment:{name:'ssr'},inspectorPort:false,persistState:false,remoteBindings:false,tunnel:false}),` : ''} redact({renderer:${JSON.stringify(reference ? 'react' : 'redact')}})] })\n`)
// Programmatic edits can arrive inside the watcher's duplicate-event window.
// Emit each completed save before checking Fast Refresh state preservation.
await writeFile(config, `import { defineConfig } from 'vite'\nimport vinext from 'vinext'\nimport { redact } from '@tanstack/redact/vinext'\nimport { cloudflare } from '@tanstack/redact/cloudflare'\nexport default defineConfig({ root: ${JSON.stringify(cwd)}, cacheDir: ${JSON.stringify(join(cwd, '.vite'))}, server: { watch: { awaitWriteFinish: { stabilityThreshold: 100, pollInterval: 10 } } }, plugins: [vinext({appDir:${JSON.stringify(cwd)}}), ${workers ? `await cloudflare({configPath:${JSON.stringify(join(cwd, 'wrangler.jsonc'))},viteEnvironment:{name:'ssr'},inspectorPort:false,persistState:false,remoteBindings:false,tunnel:false}),` : ''} redact({renderer:${JSON.stringify(reference ? 'react' : 'redact')}})] })\n`)
const env = { ...process.env, PORT: String(port), HOST: '127.0.0.1', NEXT_PUBLIC_BASE_PATH: basePath, NEXT_TELEMETRY_DISABLED: '1' }
let server, http, browser, logs = '', failure
const children = new Set()
Expand Down
Loading