Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions examples/react/start-basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@types/node": "^22.5.4",
"@types/react": "^19.0.8",
"@types/react-dom": "^19.0.3",
"@vitejs/plugin-react": "^4.6.0",
"autoprefixer": "^10.4.20",
"postcss": "^8.5.1",
"tailwindcss": "^3.4.17",
Expand Down
4 changes: 3 additions & 1 deletion examples/react/start-basic/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { tanstackStart } from '@tanstack/react-start/plugin/vite'
import { defineConfig } from 'vite'
import tsConfigPaths from 'vite-tsconfig-paths'
import viteReact from '@vitejs/plugin-react'

export default defineConfig({
server: {
Expand All @@ -10,6 +11,7 @@ export default defineConfig({
tsConfigPaths({
projects: ['./tsconfig.json'],
}),
tanstackStart(),
tanstackStart({ customViteReactPlugin: true }),
viteReact(),
],
})
1 change: 1 addition & 0 deletions examples/solid/start-basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"tailwindcss": "^3.4.17",
"typescript": "^5.7.2",
"vite": "^6.3.5",
"vite-plugin-solid": "^2.11.7",
"vite-tsconfig-paths": "^5.1.4"
}
}
4 changes: 3 additions & 1 deletion examples/solid/start-basic/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { defineConfig } from 'vite'
import tsConfigPaths from 'vite-tsconfig-paths'
import { tanstackStart } from '@tanstack/solid-start/plugin/vite'
import viteSolid from 'vite-plugin-solid'

export default defineConfig({
server: {
Expand All @@ -10,6 +11,7 @@ export default defineConfig({
tsConfigPaths({
projects: ['./tsconfig.json'],
}),
tanstackStart({}),
tanstackStart({ customViteSolidPlugin: true }),
viteSolid({ ssr: true }),
],
})
11 changes: 10 additions & 1 deletion packages/react-start-plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ export function TanStackStartVitePlugin(
WithReactPlugin
const options: OptionsWithReact = getTanStackStartOptions(opts)

if (opts?.customViteReactPlugin !== true) {
console.warn(
`please add the vite-react plugin to your Vite config and set 'customViteReactPlugin: true'`,
)
console.warn(
`TanStack Start will not configure the vite-react plugin in future anymore.`,
)
}

return [
TanStackStartVitePluginCore(
{
Expand Down Expand Up @@ -61,7 +70,7 @@ export default createStartHandler({
},
options,
),
viteReact(options.react),
!opts?.customViteReactPlugin && viteReact(options.react),
]
}

Expand Down
2 changes: 2 additions & 0 deletions packages/react-start-plugin/src/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ import type { Options as ViteReactOptions } from '@vitejs/plugin-react'

export type WithReactPlugin = {
react?: ViteReactOptions
customViteReactPlugin?: boolean
}

const frameworkPlugin = {
react: z.custom<ViteReactOptions>().optional(),
customViteReactPlugin: z.boolean().optional().default(false),
}

// eslint-disable-next-line unused-imports/no-unused-vars
Expand Down
11 changes: 10 additions & 1 deletion packages/solid-start-plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ export function TanStackStartVitePlugin(
WithSolidPlugin
const options: OptionsWithSolid = getTanStackStartOptions(opts)

if (opts?.customViteSolidPlugin !== true) {
console.warn(
`please add the vite-solid plugin to your Vite config and set 'customViteSolidPlugin: true'`,
)
console.warn(
`TanStack Start will not configure the vite-solid plugin in future anymore.`,
)
}

return [
TanStackStartVitePluginCore(
{
Expand Down Expand Up @@ -53,7 +62,7 @@ export default createStartHandler({
},
options,
),
viteSolid({ ...options.solid, ssr: true }),
!opts?.customViteSolidPlugin && viteSolid({ ...options.solid, ssr: true }),
]
}

Expand Down
2 changes: 2 additions & 0 deletions packages/solid-start-plugin/src/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ import type { Options as ViteSolidOptions } from 'vite-plugin-solid'

export type WithSolidPlugin = {
solid?: ViteSolidOptions
customViteSolidPlugin?: boolean
}

const frameworkPlugin = {
solid: z.custom<ViteSolidOptions>().optional(),
customViteSolidPlugin: z.boolean().optional().default(false),
}

// eslint-disable-next-line unused-imports/no-unused-vars
Expand Down
31 changes: 31 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.