@sentry/cloudflare/vite: Add a default export for the Vite plugin
@JPeer264 ci sta già lavorando.
Dal 20/9/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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,vinextandnitro/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/astrodefault-exports its integration, and@sentry/nuxtits module.
Notes
- The
./vitesubpath currently also declares arequirecondition. In CJS, a default export is reached asrequire('@sentry/cloudflare/vite').default. The comment at the top ofsrc/vite/index.tssays the CJS entry cannot resolve anyway (@sentry/server-utils/orchestrion/vitehas norequirecondition), 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;inpackages/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.
- Lingua principale
- TypeScript
- Stelle
- 8.7k
- Fork
- 1.9k
- Merge medio
- 1g 18h
- PR unite (30g)
- 562
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di getsentry/sentry-javascript
-
Browser Waiting for: Product Owner
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
getsentry/sentry-javascript#24577 · 1 commento ·
-
Task
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
getsentry/sentry-javascript#24558 · 1 commento ·
-
Task
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
getsentry/sentry-javascript#24557 · 1 commento ·
-
Task
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
getsentry/sentry-javascript#24556 · 1 commento ·
-
Task
Difficoltà 1/5 1-3 ore Idoneità per principianti 90/100
getsentry/sentry-javascript#24555 · 1 commento ·
Tutte le issue di getsentry/sentry-javascript
Issue simili
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
-
Mend: dependency security vulnerability untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100