File tree Expand file tree Collapse file tree 2 files changed +27
-4
lines changed
Expand file tree Collapse file tree 2 files changed +27
-4
lines changed Original file line number Diff line number Diff line change 1+ /**
2+ * Valid deployment targets for the application
3+ */
4+ export type DeploymentTarget = 'netlify' | 'vercel' | 'cloudflare-pages' | 'node-server' | 'bun' ;
5+
6+ /**
7+ * Configuration options for TanStack Start plugin
8+ */
9+ export interface TanStackStartOptions {
10+ target ?: DeploymentTarget ;
11+ }
12+
13+ /**
14+ * Validates if a string is a valid deployment target
15+ */
16+ export function isValidDeploymentTarget ( target : string ) : target is DeploymentTarget {
17+ const validTargets : DeploymentTarget [ ] = [
18+ 'netlify' ,
19+ 'vercel' ,
20+ 'cloudflare-pages' ,
21+ 'node-server' ,
22+ 'bun' ,
23+ ] ;
24+ return validTargets . includes ( target as DeploymentTarget ) ;
25+ }
Original file line number Diff line number Diff line change @@ -2,9 +2,7 @@ import tailwindcss from '@tailwindcss/vite';
22import { tanstackStart } from '@tanstack/react-start/plugin/vite' ;
33import { defineConfig , loadEnv } from 'vite' ;
44import tsConfigPaths from 'vite-tsconfig-paths' ;
5-
6- // Define valid deployment targets
7- type DeploymentTarget = 'netlify' | 'vercel' | 'cloudflare-pages' | 'node-server' | 'bun' ;
5+ import type { DeploymentTarget , TanStackStartOptions } from '~/types/deployment' ;
86
97export default defineConfig ( ( { mode } ) => {
108 // Load environment variables
@@ -14,7 +12,7 @@ export default defineConfig(({ mode }) => {
1412 const deploymentTarget = env . VITE_DEPLOYMENT_TARGET as DeploymentTarget | undefined ;
1513
1614 // Prepare tanstackStart options
17- const tanstackStartOptions : { target ?: DeploymentTarget } = { } ;
15+ const tanstackStartOptions : TanStackStartOptions = { } ;
1816 if ( deploymentTarget ) {
1917 tanstackStartOptions . target = deploymentTarget ;
2018 }
You can’t perform that action at this time.
0 commit comments