fix: the CJS build of Vite's Node API is deprecated, part 2

This commit is contained in:
huzibaca 2024-11-18 01:21:00 +08:00
parent e8b3bd5bdc
commit 824325a2eb
2 changed files with 8 additions and 2 deletions

View File

@ -99,5 +99,6 @@
"singleQuote": false,
"endOfLine": "lf"
},
"type": "module",
"packageManager": "pnpm@9.1.4"
}

View File

@ -3,7 +3,12 @@ import path from "path";
import svgr from "vite-plugin-svgr";
import react from "@vitejs/plugin-react";
import legacy from "@vitejs/plugin-legacy";
import monacoEditor from "vite-plugin-monaco-editor";
import monacoEditorPlugin, {
type IMonacoEditorOpts,
} from "vite-plugin-monaco-editor";
const monacoEditorPluginDefault = (monacoEditorPlugin as any).default as (
options: IMonacoEditorOpts
) => any;
export default defineConfig({
root: "src",
@ -23,7 +28,7 @@ export default defineConfig({
path.resolve("./src/polyfills/RegExp.js"),
],
}),
monacoEditor({
monacoEditorPluginDefault({
languageWorkers: ["editorWorkerService", "typescript", "css"],
customWorkers: [
{