Skip to content

Take ESBuild into use #262

@joonas-fi

Description

@joonas-fi
--- 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions