25 lines
877 B
TypeScript
25 lines
877 B
TypeScript
import { defineConfig } from 'vite';
|
|
import preact from '@preact/preset-vite';
|
|
|
|
// Build artefact lives at apps/widget-vojo-ai/dist/. The «Deploy widgets» task
|
|
// rsyncs it into ~/vojo/widgets/vojo-ai/ on the server, which Caddy serves from
|
|
// the widgets.vojo.chat block at /vojo-ai/ (mirror of the telegram widget).
|
|
//
|
|
// `base: './'` keeps every generated asset path relative so the same build can
|
|
// sit under /vojo-ai/ on widgets.vojo.chat without rewrites.
|
|
export default defineConfig({
|
|
base: './',
|
|
plugins: [preact()],
|
|
build: {
|
|
target: 'es2020',
|
|
sourcemap: true,
|
|
// Inline CSS for a single round-trip; the widget is tiny and the host's
|
|
// iframe handshake budget is already tight (10s default).
|
|
cssCodeSplit: false,
|
|
},
|
|
server: {
|
|
// 8081 telegram / 8082 discord / 8083 whatsapp / 8084 vojo-ai.
|
|
port: 8084,
|
|
host: true,
|
|
},
|
|
});
|