Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

chore(electron): config vitest swc (#6282)

EYHNd59e1389ec97
diff --git a/packages/frontend/electron/package.json b/packages/frontend/electron/package.json
index 24a3864fc2..f111d7b804 100644
--- a/packages/frontend/electron/package.json
+++ b/packages/frontend/electron/package.json
@@ -46,6 +46,7 @@
"@toeverything/infra": "workspace:*",
"@types/mixpanel-browser": "^2.49.0",
"@types/uuid": "^9.0.8",
+ "@vitejs/plugin-react-swc": "^3.6.0",
"builder-util-runtime": "^9.2.4",
"core-js": "^3.36.1",
"cross-env": "^7.0.3",
diff --git a/packages/frontend/electron/vitest.config.ts b/packages/frontend/electron/vitest.config.ts
index c81a3889cc..46d47c0970 100644
--- a/packages/frontend/electron/vitest.config.ts
+++ b/packages/frontend/electron/vitest.config.ts
@@ -1,11 +1,13 @@
import { resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
+import react from '@vitejs/plugin-react-swc';
import { defineConfig } from 'vitest/config';
const rootDir = fileURLToPath(new URL('../../..', import.meta.url));
export default defineConfig({
+ plugins: [react()],
resolve: {
alias: {
// prevent tests using two different sources of yjs
@@ -15,6 +17,7 @@ export default defineConfig({
},
test: {
+ setupFiles: [resolve(rootDir, './scripts/setup/global.ts')],
include: ['./test/**/*.spec.ts'],
testTimeout: 5000,
poolOptions: {
diff --git a/yarn.lock b/yarn.lock
index 51c842b297..0fc00e8895 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -468,6 +468,7 @@ __metadata:
"@toeverything/infra": "workspace:*"
"@types/mixpanel-browser": "npm:^2.49.0"
"@types/uuid": "npm:^9.0.8"
+ "@vitejs/plugin-react-swc": "npm:^3.6.0"
async-call-rpc: "npm:^6.4.0"
builder-util-runtime: "npm:^9.2.4"
core-js: "npm:^3.36.1"