T
TanStack3mo ago
like-gold

how to configure after devinxi for github pages

Hi, I switched to the current tantstack start version. Unfortunately I don't get it to run on github pages. This was the config in the app.config.ts before
import { defineConfig } from "@tanstack/react-start/config";
import tsConfigPaths from "vite-tsconfig-paths";

export const githubPagesPrefix = "/tanstack";

export default defineConfig({
routers: {
client: {
// hack to get links with subpath working,
// also need a postbuild movement of the asset files
base: githubPagesPrefix,
},
},
// vite: {
// assetsInclude: "**/*.md",
// },
vite: {
plugins: [
tsConfigPaths({
projects: ["./tsconfig.json"],
}),
],
},
server: {
compatibilityDate: "2024-11-23",
prerender: {
routes: ["/"],
crawlLinks: true,
},
static: true,
preset: "static",
},
});
import { defineConfig } from "@tanstack/react-start/config";
import tsConfigPaths from "vite-tsconfig-paths";

export const githubPagesPrefix = "/tanstack";

export default defineConfig({
routers: {
client: {
// hack to get links with subpath working,
// also need a postbuild movement of the asset files
base: githubPagesPrefix,
},
},
// vite: {
// assetsInclude: "**/*.md",
// },
vite: {
plugins: [
tsConfigPaths({
projects: ["./tsconfig.json"],
}),
],
},
server: {
compatibilityDate: "2024-11-23",
prerender: {
routes: ["/"],
crawlLinks: true,
},
static: true,
preset: "static",
},
});
Now I have this vite.config.ts, which works locally
import { defineConfig } from "vite";
import tsConfigPaths from "vite-tsconfig-paths";
import { tanstackStart } from "@tanstack/react-start/plugin/vite";

export default defineConfig({
base: "/tanstack/", // Added base path
server: {
port: 3000, // Port for local development
},
plugins: [
tsConfigPaths(),
tanstackStart({
// target: "static",
target: "github-pages", // Use GitHub Pages as the target
prerender: {
enabled: true,
crawlLinks: true,
},
}),
],
});
import { defineConfig } from "vite";
import tsConfigPaths from "vite-tsconfig-paths";
import { tanstackStart } from "@tanstack/react-start/plugin/vite";

export default defineConfig({
base: "/tanstack/", // Added base path
server: {
port: 3000, // Port for local development
},
plugins: [
tsConfigPaths(),
tanstackStart({
// target: "static",
target: "github-pages", // Use GitHub Pages as the target
prerender: {
enabled: true,
crawlLinks: true,
},
}),
],
});
The build doesn't create a index.html. Has that do be configured somewhere? Thanks
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?