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: 2 additions & 5 deletions apps/api/ui/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import { APPS } from '@epicenter/constants/apps';
import { sveltekit } from '@sveltejs/kit/vite';
import tailwindcss from '@tailwindcss/vite';
import { defineConfig, type PluginOption } from 'vite';
import { defineConfig } from 'vite';

// Dashboard is same-origin with API: in prod, served as static assets from
// `api.epicenter.so/dashboard`; in dev, the proxy below routes /api and /auth
// to the local Worker so the browser only sees same-origin requests.
const DASHBOARD_DEV_PORT = 5178;

export default defineConfig({
// Each workspace has its own physical vite install (same version), so the
// plugins' `Plugin` type is nominally distinct from this config's
// `PluginOption`. Cast until the installs dedupe to one vite.
plugins: [sveltekit(), tailwindcss()] as PluginOption[],
plugins: [sveltekit(), tailwindcss()],
server: {
port: DASHBOARD_DEV_PORT,
strictPort: true,
Expand Down
7 changes: 2 additions & 5 deletions apps/matter/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import { sveltekit } from '@sveltejs/kit/vite';
import tailwindcss from '@tailwindcss/vite';
import { defineConfig, type PluginOption } from 'vite';
import { defineConfig } from 'vite';

// Matter is desktop-only (Tauri). There is no browser build to branch on, so the
// app imports `@tauri-apps/*` directly; develop with `bun run tauri dev`.
export default defineConfig({
// Each workspace has its own physical vite install (same version), so the
// plugins' `Plugin` type is nominally distinct from this config's
// `PluginOption`. Cast until the installs dedupe to one vite.
plugins: [sveltekit(), tailwindcss()] as PluginOption[],
plugins: [sveltekit(), tailwindcss()],
clearScreen: false,
server: {
// Tauri's devUrl points here; the port must be fixed.
Expand Down
7 changes: 2 additions & 5 deletions apps/skills/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import { sveltekit } from '@sveltejs/kit/vite';
import tailwindcss from '@tailwindcss/vite';
import { defineConfig, type PluginOption } from 'vite';
import { defineConfig } from 'vite';

export default defineConfig({
// Each workspace has its own physical vite install (same version), so the
// plugins' `Plugin` type is nominally distinct from this config's
// `PluginOption`. Cast until the installs dedupe to one vite.
plugins: [sveltekit(), tailwindcss()] as PluginOption[],
plugins: [sveltekit(), tailwindcss()],
resolve: {
dedupe: ['yjs'],
},
Expand Down
14 changes: 8 additions & 6 deletions packages/vite-config/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ import { searchForWorkspaceRoot, type UserConfig } from 'vite';
*/
export function workspaceAppViteConfig(app: { port: number }): UserConfig {
return {
// A consuming app's `@sveltejs/kit` and this package can resolve different
// bun peer-variant copies of the same `vite` version (`vite@7.3.5` vs
// `vite@7.3.5+<hash>`), whose `Plugin` types are then nominally unrelated,
// so `svelte-check` rejects the array against this package's `UserConfig`.
// One vite runs at runtime; bridge the array to this package's plugin type.
plugins: [sveltekit(), tailwindcss()] as UserConfig['plugins'],
// No cast: the isolated install resolves a single `vite` peer-variant that
// every package (this one, the app, @sveltejs/kit, @tailwindcss/vite)
// symlinks to, so the plugins' `Plugin` type matches this `UserConfig`. If
// CI ever reports `Two different types with this name exist, but they are
// unrelated` on this line again, bun re-split `vite` into peer-variants
// (`vite@7.3.5+<hashA>` vs `+<hashB>`); restore `as UserConfig['plugins']`
// here, the one place every workspace app's plugins come from.
plugins: [sveltekit(), tailwindcss()],
resolve: {
dedupe: ['yjs'],
},
Expand Down
Loading