fix: Build client-side JS bundle for demo page
- Add bun build step to create browser-compatible JS from TypeScript - Update demo.html to import from /dist/index.js - Update server to serve /dist/* for bundled modules Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
e0b30e52ef
commit
c18b84b7c9
|
|
@ -17,8 +17,8 @@ COPY src/encryptid ./src/encryptid
|
|||
COPY public ./public
|
||||
COPY tsconfig.json ./
|
||||
|
||||
# Build (if needed - Bun can run TS directly)
|
||||
# RUN bun build ./src/encryptid/server.ts --target=bun --outdir=./dist
|
||||
# Build client-side modules for browser
|
||||
RUN bun build ./src/encryptid/index.ts --outdir=./src/encryptid/dist --target=browser --minify
|
||||
|
||||
# Production stage
|
||||
FROM oven/bun:1.1-slim
|
||||
|
|
|
|||
|
|
@ -428,11 +428,7 @@
|
|||
signData,
|
||||
verifySignature,
|
||||
AuthLevel,
|
||||
} from './index.ts';
|
||||
|
||||
// Import UI components (registers custom elements)
|
||||
import './ui/guardian-setup.ts';
|
||||
import './ui/login-button.ts';
|
||||
} from '/dist/index.js';
|
||||
|
||||
// ========================================================================
|
||||
// CAPABILITY DETECTION
|
||||
|
|
|
|||
|
|
@ -432,6 +432,8 @@ async function generateSessionToken(userId: string, username: string): Promise<s
|
|||
|
||||
// Serve demo page and static assets
|
||||
app.get('/demo.html', serveStatic({ path: './src/encryptid/demo.html' }));
|
||||
// Serve bundled JavaScript modules
|
||||
app.use('/dist/*', serveStatic({ root: './src/encryptid/' }));
|
||||
app.use('/demo/*', serveStatic({ root: './src/encryptid/' }));
|
||||
app.use('/static/*', serveStatic({ root: './public/' }));
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue