e01df49Embeddable <toy-instrument-sim> widget (src/embed.ts): 3D model, replay and audio from the shared cache, or run in the browser and stored with the passcode; cache results as light and frames entries (CACHE_VERSION 2); instrument configs and link settings shared by the page and the widgetJeremy Magland 1import { defineConfig } from 'vite';
3// The embeddable widget (src/embed.ts): one ES module that defines <toy-instrument-sim>,
4// with three.js, the styles and the solver worker inlined, so it runs from any origin.
5export default defineConfig({
6 worker: { format: 'es' },
7 build: {
8 outDir: 'embed-dist',
9 emptyOutDir: true,
10 copyPublicDir: false,
11 lib: { entry: 'src/embed.ts', formats: ['es'], fileName: () => 'toy-instruments-embed.js' },
12 },
13});