diff --git a/app.config.ts b/app.config.ts index bc2eb88..48eac15 100644 --- a/app.config.ts +++ b/app.config.ts @@ -43,6 +43,7 @@ export default defineConfig({ port: 3000, warmup: { clientFiles: ["./src/app.tsx"] }, }, + build: { sourcemap: true }, resolve: { alias: Object.fromEntries( Object.entries(tsconfig.compilerOptions.paths).map(([key, value]) => [ diff --git a/package.json b/package.json index 4fd8693..30f7255 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "dev": "vinxi dev", "build": "vinxi build", "start": "vinxi start", + "serve": "cd .output && npx http-server public -p 3000", "version": "vinxi version" }, "dependencies": { diff --git a/src/routes.tsx b/src/routes.tsx index e277aaa..1e46276 100644 --- a/src/routes.tsx +++ b/src/routes.tsx @@ -11,7 +11,8 @@ export const routes: RouteDefinition[] = [ path: "/articles/:name", component: (p) => { // router bug: 'name' not in 'p', update when this is fixed - const name = p.location.pathname.replace(`${config.base}/articles/`, ""); + let name = p.location.pathname.replace(`${config.base}/articles/`, ""); + if (name.endsWith("/")) name = name.slice(0, -1); return (