mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-09 21:07:46 +00:00
[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:
17
packages/gatsby-plugin-vercel-analytics/gatsby-browser.js
Normal file
17
packages/gatsby-plugin-vercel-analytics/gatsby-browser.js
Normal 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 });
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user