T
TanStack3mo ago
optimistic-gold

Tanstack start missing index.html for `static` build

We have just upgrade to use tanstack vite plugin, but for target static, it build to _shell.html instead of index.html, we can workaround by running a script but hope it can be fixed completely This is our config
import { defineConfig } from 'vite'
import { tanstackStart } from '@tanstack/react-start/plugin/vite'
import tsConfigPaths from 'vite-tsconfig-paths';
import {lingui} from '@lingui/vite-plugin';
import legacy from '@vitejs/plugin-legacy';
import tailwindcss from "tailwindcss";

export default defineConfig({
plugins: [
tsConfigPaths({
projects: ['./tsconfig.json'],
}),
lingui(),

tanstackStart({
spa: {
enabled:true,
prerender: {
enabled: false,
}
},
react: {
babel: {
plugins: ['@lingui/babel-plugin-lingui-macro'],
},
},
pages: [{
path: '/',
prerender: {
enabled: false
}
}],
target: 'static',

}),
legacy({
targets: ['defaults', 'not IE 11'],
renderLegacyChunks: false,
polyfills: ['es/object/has-own'],
}),
],
css: {
postcss: {
plugins: [tailwindcss()],
},
},
})
import { defineConfig } from 'vite'
import { tanstackStart } from '@tanstack/react-start/plugin/vite'
import tsConfigPaths from 'vite-tsconfig-paths';
import {lingui} from '@lingui/vite-plugin';
import legacy from '@vitejs/plugin-legacy';
import tailwindcss from "tailwindcss";

export default defineConfig({
plugins: [
tsConfigPaths({
projects: ['./tsconfig.json'],
}),
lingui(),

tanstackStart({
spa: {
enabled:true,
prerender: {
enabled: false,
}
},
react: {
babel: {
plugins: ['@lingui/babel-plugin-lingui-macro'],
},
},
pages: [{
path: '/',
prerender: {
enabled: false
}
}],
target: 'static',

}),
legacy({
targets: ['defaults', 'not IE 11'],
renderLegacyChunks: false,
polyfills: ['es/object/has-own'],
}),
],
css: {
postcss: {
plugins: [tailwindcss()],
},
},
})
No description
5 Replies
optimistic-gold
optimistic-goldOP3mo ago
Just found this dicussion https://github.com/TanStack/router/discussions/3394, but still not sure how to make index.html exist again
GitHub
[RFC] SPA Mode Enhancements · TanStack router · Discussion #3394
TanStack Start is a unique opportunity for SPAs to have server-side features, but may come with some decisions to make. What does SPA mode mean? From my perspective, SPA mode is a general term for ...
stormy-gold
stormy-gold3mo ago
so you need the filename to be configurable ?
optimistic-gold
optimistic-goldOP3mo ago
Kind of I think, all of our systems (and other popular http-server package) depend on traditional index.html for serving
stormy-gold
stormy-gold3mo ago
can you please create an issue for that?
optimistic-gold
optimistic-goldOP3mo ago
Thanks! I will

Did you find this page helpful?