-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathastro.config.mjs
More file actions
37 lines (36 loc) · 1.53 KB
/
Copy pathastro.config.mjs
File metadata and controls
37 lines (36 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// @ts-check
import { defineConfig } from "astro/config"
import vue from "@astrojs/vue"
import tailwindcss from "@tailwindcss/vite"
import node from "@astrojs/node"
// Interscript.org v2 — Astro 7 + Vite 8 + Tailwind 4 + Vue 3 islands.
// Static output by default; per-route opt-out via `export const prerender = false`.
// The /api/* endpoints are real on-demand Node routes served via
// @astrojs/node. Deploy target: any Node-capable host.
export default defineConfig({
site: "https://www.interscript.org",
// Collapse whitespace to a single space (pre-7 behavior) instead of
// JSX-style removal, which glues text to adjacent inline elements.
compressHTML: true,
output: "static",
adapter: node({ mode: "standalone" }),
integrations: [vue()],
vite: {
plugins: [tailwindcss()],
// interscript-ts ships ml/session/*-web.js with undeclared
// onnxruntime-web / @litertjs/core imports behind lazy dynamic
// imports; the transliteration path never loads them, but the dev
// scanner and rolldown still try to resolve them.
optimizeDeps: { exclude: ["interscript-ts"] },
// onnxruntime-web must NOT be externalized: the /neural demo loads
// the ML engine lazily in the browser, and an externalized bare
// specifier is unresolvable at runtime (the deployed demo failed
// with "Failed to resolve module specifier 'onnxruntime-web'").
// Node-only backends stay external — the client never imports them.
build: {
rolldownOptions: {
external: ["onnxruntime-node"],
},
},
},
})