We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error occurred during Vite build:
Version:
"agora-electron-sdk": "^4.4.0", "electron": "^22.3.27", "electron-builder": "^23.6.0", "vite": "^4.1.4", "vite-electron-plugin": "^0.8.2", "vite-plugin-electron": "^0.11.1"
I have already tried it https://electron-vite.github.io/guide/cpp-addons.html, It still doesn't work.
The text was updated successfully, but these errors were encountered:
me too
Sorry, something went wrong.
因为 agora-electron-sdk 属于 electron 进程的模块,且还用到了webpack 的能力!
agora-electron-sdk
electron
所以若你的渲染进程(既renderer ,也就是web) 是现代化项目( 需要打包或者编译)的话,需要在渲染进程项目中 忽略此包被打包 或 编译 或依赖预构建 的步骤,也就是 需如下配置:
若您的项目为webapck项目 ,则需要项目中配置 webpack.config.js:
webpack.config.js
{ externals: { "agora-electron-sdk": "commonjs2 agora-electron-sdk" // 排除agora-electron-sdk依赖项 } }
若您的项目为vite项目 ,则需要项目中配置 vite.config.js:
vite.config.js
{ optimizeDeps: { exclude: ['agora-electron-sdk'] // 排除agora-electron-sdk依赖项 } }
不仅仅是此插件,在electron 集成 node 环境之后, 若在渲染进程中使用electron的模块或Node模块 最好都要这么处理!
对于项使用vite 和 electron结合的,这里我整理了完整的流程!
No branches or pull requests
Error occurred during Vite build:
Version:
"agora-electron-sdk": "^4.4.0",
"electron": "^22.3.27",
"electron-builder": "^23.6.0",
"vite": "^4.1.4",
"vite-electron-plugin": "^0.8.2",
"vite-plugin-electron": "^0.11.1"
I have already tried it https://electron-vite.github.io/guide/cpp-addons.html, It still doesn't work.
The text was updated successfully, but these errors were encountered: