Skip to content

feat(vite): Update return type of vite plugin #728

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
5 changes: 2 additions & 3 deletions packages/vite-plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
createComponentNameAnnotateHooks,
Logger,
} from "@sentry/bundler-plugin-core";
import { UnpluginOptions } from "unplugin";
import { UnpluginOptions, VitePlugin } from "unplugin";

function viteReleaseInjectionPlugin(injectionCode: string): UnpluginOptions {
return {
Expand Down Expand Up @@ -73,8 +73,7 @@ const sentryUnplugin = sentryUnpluginFactory({
bundleSizeOptimizationsPlugin: viteBundleSizeOptimizationsPlugin,
});

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const sentryVitePlugin: (options?: Options) => any = sentryUnplugin.vite;
export const sentryVitePlugin: (options?: Options) => VitePlugin[] = sentryUnplugin.vite;

export type { Options as SentryVitePluginOptions } from "@sentry/bundler-plugin-core";
export { sentryCliBinaryExists } from "@sentry/bundler-plugin-core";
3 changes: 1 addition & 2 deletions packages/vite-plugin/test/public-api.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { VitePlugin } from "unplugin";
import { sentryVitePlugin } from "../src";

test("Vite plugin should exist", () => {
Expand All @@ -16,7 +15,7 @@ describe("sentryVitePlugin", () => {
authToken: "test-token",
org: "test-org",
project: "test-project",
}) as VitePlugin[];
});

expect(Array.isArray(plugins)).toBe(true);

Expand Down
Loading