Skip to content

Commit 9faeb10

Browse files
authored
Fix build (#26)
* Fix build * Fix formating
1 parent 15b7c8e commit 9faeb10

File tree

6 files changed

+1104
-1104
lines changed

6 files changed

+1104
-1104
lines changed

bun.lock

Lines changed: 1045 additions & 1097 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@
3232
"@tanstack/react-form": "^1.15.2",
3333
"@tanstack/react-pacer": "^0.11.0",
3434
"@tanstack/react-query": "^5.84.1",
35-
"@tanstack/react-router": "1.125.3",
36-
"@tanstack/react-router-with-query": "1.125.3",
37-
"@tanstack/react-start": "1.125.3",
38-
"@tanstack/zod-adapter": "^1.130.11",
35+
"@tanstack/react-router": "1.127.3",
36+
"@tanstack/react-router-with-query": "1.127.3",
37+
"@tanstack/react-start": "1.127.3",
38+
"@tanstack/zod-adapter": "^1.127.3",
3939
"ai": "^4.3.19",
4040
"class-variance-authority": "^0.7.1",
4141
"clsx": "^2.1.1",
@@ -56,8 +56,8 @@
5656
},
5757
"devDependencies": {
5858
"@tanstack/react-query-devtools": "^5.84.1",
59-
"@tanstack/react-router-devtools": "^1.130.11",
60-
"@tanstack/router-plugin": "^1.130.11",
59+
"@tanstack/react-router-devtools": "^1.127.3",
60+
"@tanstack/router-plugin": "^1.127.3",
6161
"@testing-library/jest-dom": "^6.6.4",
6262
"@testing-library/react": "^16.3.0",
6363
"@testing-library/user-event": "^14.6.1",

public/404.html

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>Commandly</title>
6+
<script type="text/javascript">
7+
var pathSegmentsToKeep = 0;
8+
9+
var l = window.location;
10+
l.replace(
11+
l.protocol +
12+
"//" +
13+
l.hostname +
14+
(l.port ? ":" + l.port : "") +
15+
l.pathname
16+
.split("/")
17+
.slice(0, 1 + pathSegmentsToKeep)
18+
.join("/") +
19+
"/?/" +
20+
l.pathname
21+
.slice(1)
22+
.split("/")
23+
.slice(pathSegmentsToKeep)
24+
.join("/")
25+
.replace(/&/g, "~and~") +
26+
(l.search ? "&" + l.search.slice(1).replace(/&/g, "~and~") : "") +
27+
l.hash
28+
);
29+
</script>
30+
</head>
31+
<body></body>
32+
</html>

public/spa-redirect.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
(function (l) {
2+
if (l.search[1] === "/") {
3+
var decoded = l.search
4+
.slice(1)
5+
.split("&")
6+
.map(function (s) {
7+
return s.replace(/~and~/g, "&");
8+
})
9+
.join("?");
10+
window.history.replaceState(
11+
null,
12+
null,
13+
l.pathname.slice(0, -1) + decoded + l.hash
14+
);
15+
}
16+
})(window.location);

src/routes/__root.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ function RootDocument({ children }: { children: React.ReactNode }) {
144144
return (
145145
<html suppressHydrationWarning={true}>
146146
<head>
147+
<script src="/spa-redirect.js"></script>
147148
<HeadContent />
148149
</head>
149150
<body className="bg-background text-foreground antialiased">

vite.config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { defineConfig } from "vite";
22
import tsConfigPaths from "vite-tsconfig-paths";
33
import { tanstackStart } from "@tanstack/react-start/plugin/vite";
4+
import viteReact from "@vitejs/plugin-react";
45
export default defineConfig({
56
build: {
67
emptyOutDir: true
@@ -10,6 +11,7 @@ export default defineConfig({
1011
projects: ["./tsconfig.json"]
1112
}),
1213
tanstackStart({
14+
customViteReactPlugin: true,
1315
pages: [
1416
{
1517
path: "/",
@@ -37,7 +39,8 @@ export default defineConfig({
3739
}
3840
},
3941
target: "github-pages"
40-
})
42+
}),
43+
viteReact()
4144
],
4245
server: {
4346
port: 4001

0 commit comments

Comments
 (0)