Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

@sentry/cloudflare/vite: Add a default export for the Vite plugin

Open
#24,526 1 comment 0 reactions 1 assignee View on GitHub

@JPeer264 is already working on this.

Since Sep 20, 2026.

Assessment

This issue has not been assessed yet.

Description

Cloudflare Workers Feature
Description

Add a default export to the @sentry/cloudflare/vite subpath, as an alias of sentryCloudflareVitePlugin, so the plugin can be imported under any name:

// vite.config.ts
import { cloudflare } from '@cloudflare/vite-plugin';
import sentry from '@sentry/cloudflare/vite';
import { defineConfig } from 'vite';

export default defineConfig({
  plugins: [cloudflare(), sentry()],
});

sentryCloudflareVitePlugin stays the documented name, so this is additive and breaks nothing.

// packages/cloudflare/src/vite/index.ts
export default sentryCloudflareVitePlugin;
Why
  • Most Vite plugins default-export, for example @vitejs/plugin-react, vinext and nitro/vite. A default export matches what users expect at that place in the config.
  • The call site reads better with a short local name: plugins: [cloudflare(), sentry()].
  • There is precedent in this repo: @sentry/astro default-exports its integration, and @sentry/nuxt its module.
Notes
  • The ./vite subpath currently also declares a require condition. In CJS, a default export is reached as require('@sentry/cloudflare/vite').default. The comment at the top of src/vite/index.ts says the CJS entry cannot resolve anyway (@sentry/server-utils/orchestrion/vite has no require condition), and Vite configs are ESM in practice, so this is acceptable.
  • Sentry's other Vite plugins (@sentry/vite-plugin, SvelteKit, SolidStart) use named exports only, so this makes the Cloudflare one the exception. The named export stays, and docs keep using it.
  • The subpath exports more than the plugin (the options type today), so the JSDoc on the default export should state that it is an alias of sentryCloudflareVitePlugin.
Scope
  • export default sentryCloudflareVitePlugin; in packages/cloudflare/src/vite/index.ts, with JSDoc.
  • A test asserting the default export is the same function as the named one.
  • Optionally a docs snippet showing the short import.
Dominant language
TypeScript
Stars
8.7k
Forks
1.9k
Avg merge
1d 18h
Merged PRs (30d)
543

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from getsentry/sentry-javascript

All issues in getsentry/sentry-javascript

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.