Skip to content

Commit

Permalink
fix: compatible vitest #26
Browse files Browse the repository at this point in the history
  • Loading branch information
caoxiemeihao committed Apr 18, 2024
1 parent b0f59fb commit 28f7b4a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,10 @@ window.ipcRenderer.on('main-process-message', (_event, message) => {
// Ployfill the Electron and Node.js API for Renderer process.
// If you want use Node.js in Renderer process, the \`nodeIntegration\` needs to be enabled in the Main process.
// See 👉 https://github.com/electron-vite/vite-plugin-electron-renderer
renderer: {},
renderer: process.env.NODE_ENV === 'test'
// https://github.com/electron-vite/vite-plugin-electron-renderer/issues/78#issuecomment-2053600808
? undefined
: {},
})`
if (framework === 'vue' || framework === 'react') {
editFile(path.join(root, 'vite.config.ts'), content =>
Expand Down

0 comments on commit 28f7b4a

Please sign in to comment.