mirror of
https://github.com/Such-Software/smirk-backend-core.git
synced 2026-10-17 07:21:32 +02:00
Preact + Vite standalone admin-ui bundled into the server binary via rust-embed. Login is NIP-07 (Smirk wallet signs the NIP-98 admin challenge); tabs cover instance status, admin keys, invite codes, and the effective-config editor (live vs restart-required per field). admin-ui/dist is committed because rust-embed reads it at compile time; node_modules is gitignored (npm ci reproduces it). A lib test asserts index.html and the /admin/ asset base are embedded so an unbuilt console fails the build instead of an operator. The console is served on the admin plane only (loopback bind), behind the existing NIP-98 admin_guard + MAC allowlist.
19 lines
515 B
TypeScript
19 lines
515 B
TypeScript
import { defineConfig } from 'vite';
|
|
|
|
// Served by the Rust backend at /admin (rust-embed). `base: '/admin/'` makes the
|
|
// built asset URLs absolute under /admin/assets/ so they resolve regardless of the
|
|
// trailing slash. Preact JSX via esbuild (no plugin, keeps the toolchain tiny).
|
|
export default defineConfig({
|
|
base: '/admin/',
|
|
build: {
|
|
outDir: 'dist',
|
|
target: 'es2022',
|
|
emptyOutDir: true,
|
|
assetsDir: 'assets',
|
|
},
|
|
esbuild: {
|
|
jsx: 'automatic',
|
|
jsxImportSource: 'preact',
|
|
},
|
|
});
|