Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/vite-plugin/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const extensions = [".ts"];

export default {
input,
external: [...Object.keys(packageJson.dependencies), ...modulePackage.builtinModules],
external: [...Object.keys(packageJson.dependencies), ...modulePackage.builtinModules, "vite"],
onwarn: (warning) => {
if (warning.code === "CIRCULAR_DEPENDENCY") {
// Circular dependencies are usually not a big deal for us so let's just warn about them
Expand Down
10 changes: 3 additions & 7 deletions packages/vite-plugin/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import { SentryRollupPluginOptions } from "@sentry/rollup-plugin";
import { _rollupPluginInternal } from "@sentry/rollup-plugin";
import { createRequire } from "node:module";
import { Plugin } from "vite";
import vite, { Plugin } from "vite";

function getViteMajorVersion(): string | undefined {
try {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore - Rollup already transpiles this for us
const req = createRequire(import.meta.url);
const vite = req("vite") as { version?: string };
return vite.version?.split(".")[0];
// The version export was only added in Vite v3?
return vite?.version?.split(".")[0];
} catch (err) {
// do nothing, we'll just not report a version
}
Expand Down
Loading