[gatsby-plugin-vercel-analytics] Remove "babel" compilation (#10546)

The "babel" build for this package essentially does nothing. The output is still using ESM and no transformation is done. Let's just remove the "build" script entirely.
This commit is contained in:
Nathan Rajlich
2023-09-19 17:45:26 -03:00
committed by GitHub
parent f5ca497b75
commit b8bc682d3e
6 changed files with 7 additions and 54 deletions

View File

@@ -0,0 +1,17 @@
import { webVitals } from "./web-vitals";
export const onClientEntry = (_, pluginOptions = {}) => {
let options = {
debug: false,
...pluginOptions,
analyticsId: process.env.GATSBY_VERCEL_ANALYTICS_ID,
};
if (!options.analyticsId) {
return null;
}
if (options.debug || process.env.NODE_ENV === "production") {
webVitals({ options });
}
};