Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "https://openapi.vercel.sh/vercel.json",
"buildCommand": "bun run build",
"outputDirectory": "dist",
"cleanUrls": true,
"redirects": [{ "source": "/", "destination": "/uk/introducing-policyengine-uk-chat", "permanent": false }]
}
13 changes: 11 additions & 2 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

// The article is proxied by policyengine-app-v2's zone routes, which forward
// /uk/introducing-policyengine-uk-chat and everything beneath it to this
// deployment path-for-path. Serving the build at that same path on our own
// Vercel domain means an asset URL resolves identically whether the reader
// arrived via policyengine.org or the deployment directly — the pattern
// /uk/chat and the WATCA calculator already use.
const ARTICLE_PATH = '/uk/introducing-policyengine-uk-chat';

export default defineConfig({
base: './',
base: `${ARTICLE_PATH}/`,
plugins: [react()],
optimizeDeps: {
entries: ['index.html'],
},
build: {
outDir: 'dist',
outDir: `dist${ARTICLE_PATH}`,
emptyOutDir: true,
},
});
Loading