concept-collection / stan-web-ide
stan-web-ide / vite.config.ts
22 lines · 910 BBlameHistoryRaw
1import { fileURLToPath } from 'node:url';
2import { defineConfig, mergeConfig } from 'vite';
3import { minwebide } from 'minwebide/vite';
5// DEPLOY_BASE is set by CI when building for GitHub Pages
6// (the site is served from /stan-web-ide/, not the domain root).
7//
8// No special headers are needed: the compiled Stan models are pure-WASI
9// modules run single-threaded, one worker per chain — no SharedArrayBuffer,
10// so no cross-origin isolation. The compile server allows any origin.
11export default defineConfig(mergeConfig(minwebide(), {
12 base: process.env.DEPLOY_BASE ?? '/',
13 resolve: {
14 alias: {
15 // stan-language-server imports node's 'path' (join only)
16 path: fileURLToPath(new URL('./src/stan/pathShim.ts', import.meta.url)),
17 },
18 },
19 // fixed host/port only so the check scripts know where to look
20 server: { host: '127.0.0.1', port: 3000 },
21 preview: { host: '127.0.0.1', port: 4173 },
22}));