{"version":3,"file":"index.mjs","names":[],"sources":["../../src/index.ts"],"sourcesContent":["import type { SentryRollupPluginOptions } from \"@sentry/rollup-plugin\";\nimport { _rollupPluginInternal } from \"@sentry/rollup-plugin\";\nimport { createRequire } from \"node:module\";\n\ninterface SentryVitePlugin {\n  name: string;\n  enforce: \"pre\";\n}\n\nfunction getViteMajorVersion(): string | undefined {\n  try {\n    // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n    // @ts-ignore - Rollup already transpiles this for us\n    const req = createRequire(import.meta.url);\n    const vite = req(\"vite\") as { version?: string };\n    return vite.version?.split(\".\")[0];\n  } catch (err) {\n    // do nothing, we'll just not report a version\n  }\n\n  return undefined;\n}\n\nexport const sentryVitePlugin = (options?: SentryRollupPluginOptions): SentryVitePlugin[] => {\n  return [\n    {\n      enforce: \"pre\",\n      ..._rollupPluginInternal(options, \"vite\", getViteMajorVersion()),\n    },\n  ];\n};\n\nexport type { Options as SentryVitePluginOptions } from \"@sentry/bundler-plugin-core\";\nexport { sentryCliBinaryExists } from \"@sentry/bundler-plugin-core\";\n"],"mappings":";;;;AASA,SAAS,sBAA0C;CACjD,IAAI;EAKF,OAFY,cAAc,OAAO,KAAK,IACtB,CAAC,OACN,CAAC,SAAS,MAAM,IAAI,CAAC;UACzB,KAAK;;AAOhB,MAAa,oBAAoB,YAA4D;CAC3F,OAAO,CACL;EACE,SAAS;EACT,GAAG,sBAAsB,SAAS,QAAQ,qBAAqB,CAAC;EACjE,CACF"}