--- a/frontend/main.tsx
+++ b/frontend/main.tsx
@@ -153,3 +153,5 @@ export function main(appElement: HTMLElement, config: GlobalConfig): void {
makeRouter(r.hasRouteFor, (relativeUrl: string) => r.handle(relativeUrl, handlers)),
);
}
+
+(window as any).main = { main: main };
HTML entry doesn't need changes.
shim.js:
import jQuery from 'jquery/dist/jquery.slim.js';
export { jQuery };
Then:
cd frontend/
tsc --project .
esbuild --bundle main.js --inject:shim.js --outfile=../public/build.js --minify
HTML entry doesn't need changes.
shim.js:Then: