Skip to content

Commit

Permalink
fix: noExternal all start modules
Browse files Browse the repository at this point in the history
  • Loading branch information
tannerlinsley committed Jan 22, 2025
1 parent 869d379 commit bc27586
Showing 1 changed file with 20 additions and 28 deletions.
48 changes: 20 additions & 28 deletions packages/start-config/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,7 @@ export function defineConfig(
viteConfig.userConfig.ssr,
clientViteConfig.userConfig.ssr,
{
noExternal: [
'@tanstack/start',
'@tanstack/start-router-manifest',
'@tanstack/start-server-functions-handler',
'tsr:routes-manifest',
'tsr:server-fn-manifest',
],
noExternal,
},
]),
optimizeDeps: {
Expand Down Expand Up @@ -251,13 +245,7 @@ export function defineConfig(
viteConfig.userConfig.ssr,
ssrViteConfig.userConfig.ssr,
{
noExternal: [
'@tanstack/start',
'@tanstack/start-router-manifest',
'@tanstack/start-server-functions-handler',
'tsr:routes-manifest',
'tsr:server-fn-manifest',
],
noExternal,
external: ['@vinxi/react-server-dom/client'],
},
]),
Expand Down Expand Up @@ -321,13 +309,7 @@ export function defineConfig(
viteConfig.userConfig.ssr,
serverViteConfig.userConfig.ssr,
{
noExternal: [
'@tanstack/start',
'@tanstack/start-router-manifest',
'@tanstack/start-server-functions-handler',
'tsr:routes-manifest',
'tsr:server-fn-manifest',
],
noExternal,
},
]),
optimizeDeps: {
Expand Down Expand Up @@ -373,6 +355,22 @@ export function defineConfig(
],
})

const noExternal = [
'@tanstack/start',
'@tanstack/start-client',
'@tanstack/start-server',
'@tanstack/start-server-functions-fetcher',
'@tanstack/start-server-functions-handler',
'@tanstack/start-server-functions-client',
'@tanstack/start-server-functions-ssr',
'@tanstack/start-server-functions-server',
'@tanstack/start-router-manifest',
'@tanstack/start-config',
'@tanstack/server-functions-plugin',
'tsr:routes-manifest',
'tsr:server-fn-manifest',
]

// If API routes handler exists, add a router for it
if (apiEntryExists) {
vinxiApp = vinxiApp.addRouter({
Expand All @@ -395,13 +393,7 @@ export function defineConfig(
viteConfig.userConfig.ssr,
apiViteConfig.userConfig.ssr,
{
noExternal: [
'@tanstack/start',
'@tanstack/start-router-manifest',
'@tanstack/start-server-functions-handler',
'tsr:routes-manifest',
'tsr:server-fn-manifest',
],
noExternal,
},
]),
optimizeDeps: {
Expand Down

0 comments on commit bc27586

Please sign in to comment.