We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1271ced commit 0f6a1e6Copy full SHA for 0f6a1e6
1 file changed
packages/vite-plugin/src/index.ts
@@ -1,15 +1,10 @@
1
import { SentryRollupPluginOptions } from "@sentry/rollup-plugin";
2
import { _rollupPluginInternal } from "@sentry/rollup-plugin";
3
-import { createRequire } from "node:module";
4
-import { Plugin } from "vite";
+import { Plugin, version } from "vite";
5
6
function getViteMajorVersion(): string | undefined {
7
try {
8
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
9
- // @ts-ignore - Rollup already transpiles this for us
10
- const req = createRequire(import.meta.url);
11
- const vite = req("vite") as { version?: string };
12
- return vite.version?.split(".")[0];
+ return version?.split(".")[0];
13
} catch (err) {
14
// do nothing, we'll just not report a version
15
}
0 commit comments