From 4fa8b1f11889f7153e62e31eaf06427627abd583 Mon Sep 17 00:00:00 2001 From: Slinetrac Date: Tue, 18 Nov 2025 16:51:41 +0800 Subject: [PATCH] chore(types): refine monaco plugin default export typing --- vite.config.mts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/vite.config.mts b/vite.config.mts index 2f6c380ed..a1d9f7b4c 100644 --- a/vite.config.mts +++ b/vite.config.mts @@ -2,9 +2,7 @@ import path from "node:path"; import legacy from "@vitejs/plugin-legacy"; import react from "@vitejs/plugin-react-swc"; -import monacoEditorPlugin, { - type IMonacoEditorOpts, -} from "vite-plugin-monaco-editor-esm"; +import monacoEditorPlugin from "vite-plugin-monaco-editor-esm"; import svgr from "vite-plugin-svgr"; import { defineConfig } from "vitest/config"; @@ -95,8 +93,12 @@ const chunkRules: ChunkRule[] = [ !!pkg && LARGE_VENDOR_MATCHERS.some((keyword) => pkg.includes(keyword)), }, ]; -const monacoEditorPluginDefault = ((monacoEditorPlugin as any).default ?? - monacoEditorPlugin) as (options: IMonacoEditorOpts) => any; +const monacoEditorPluginDefault: typeof monacoEditorPlugin = + ( + monacoEditorPlugin as typeof monacoEditorPlugin & { + default?: typeof monacoEditorPlugin; + } + ).default ?? monacoEditorPlugin; export default defineConfig({ root: "src",