mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-06 12:57:46 +00:00
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.
18 lines
373 B
JavaScript
18 lines
373 B
JavaScript
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 });
|
|
}
|
|
};
|