fix: update fallback (#5115)

* fix: update fallback

* test: introduce Vitest and add semver helper tests

* chore: merge vitest config into vite
This commit is contained in:
Sline
2025-10-18 15:51:34 +08:00
committed by GitHub
parent 3d09cf0666
commit c465000178
10 changed files with 661 additions and 24 deletions

View File

@@ -1,11 +1,12 @@
import { defineConfig } from "vite";
import path from "path";
import svgr from "vite-plugin-svgr";
import react from "@vitejs/plugin-react";
import path from "node:path";
import legacy from "@vitejs/plugin-legacy";
import react from "@vitejs/plugin-react";
import { defineConfig } from "vitest/config";
import monacoEditorPlugin, {
type IMonacoEditorOpts,
} from "vite-plugin-monaco-editor";
import svgr from "vite-plugin-svgr";
const monacoEditorPluginDefault = (monacoEditorPlugin as any).default as (
options: IMonacoEditorOpts,
) => any;
@@ -159,6 +160,10 @@ export default defineConfig({
"@root": path.resolve("."),
},
},
test: {
environment: "node",
include: ["**/*.{test,spec}.{ts,tsx}"],
},
define: {
OS_PLATFORM: `"${process.platform}"`,