js

val js: <Error class: unknown class>

Web Vitals handler script. Built with the following: web-vitals@3.1.0 esbuild@0.15.18

Original script contains:

import { onFCP, onTTFB, onFID } from "web-vitals";
const portalName = JSON.parse(AndroidInitialContext.initialContext()).name;
onFCP(report => WebVitals.fcp(portalName, report.value));
onTTFB(report => WebVitals.ttfb(portalName, report.value));
onFID(report => WebVitals.fid(portalName, report.value));

Build command: esbuild ./index.js --bundle --minify --tree-shaking=true --platform=browser --outfile=dist/index.js