// Static imports on purpose: Pixi registers render pipes (graphics, text, sprite) as a // module side effect, and a renderer only knows the pipes that exist when it is created. // Lazy chunks loaded after `app.init()` would therefore fail with "unknown render pipe". import { captureConsole } from './editor/console/log'; import { startEditor } from './editor/App'; import { mountPlayground } from './playground'; import { createPage, showFailure } from './page'; // Before anything else: a renderer warns while it is being created, and those warnings are // exactly the ones worth having in the panel. captureConsole(); async function main(): Promise { const params = new URLSearchParams(location.search); const { app, root } = await createPage(params); if (params.has('playground')) mountPlayground(app, root); else await startEditor(app, root); } window.addEventListener('error', (event) => { const error: unknown = event.error; console.error('[uncaught]', error instanceof Error ? error.stack : event.message); }); main().catch(showFailure);