FlowFuse / website

The FlowFuse Website
https://flowfuse.com
MIT License
22 stars 13 forks source link

Separating All Third-Party Scripts Included in base.njk into a Separate JavaScript File #2334

Open sumitshinde-84 opened 1 month ago

sumitshinde-84 commented 1 month ago

Description

Currently, we have several third-party scripts (HubSpot, PostHog, Clickbit, etc.) directly included in the base.njk file. However, when we build the website, our bundler does not bundle them like it does for JavaScript files. Each script tag results in a separate HTTP request, contributing to slower website load speeds. To improve performance, we should consolidate all third-party scripts into a separate JavaScript file, allowing our bundler to bundle them efficiently.

Epic/Story

No response

Have you provided an initial effort estimate for this issue?

I have provided an initial effort estimate

sumitshinde-84 commented 1 month ago

cc @joepavitt , @cstns

joepavitt commented 1 month ago

I'm not sure how we'd go about this with Eleventy. We inject these as third-party scripts. They're marked as async (or at least, they should be) so wouldn't block the loading of the rest of the content on the site