You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Firstly, Vite library mode includes opinionated configuration for browser-oriented libraries which may not suitable for the main and renderer processes which are not modules to be imported by other modules.
Secondly, if the output is ESM, it won't be minified (white spaces are kept) in lib mode, which is a long-lived issue of Vite.
Just because the build.lib API is so simple, the default configuration is more suitable for building a Node.js/Electron application.
The renderer process does not use the build.lib API, and it is not even interfered by vite-plugin-electron. Thanks for your suggestion, I will consider this suggestion in the future.
kingyue737
changed the title
[Question] why use library mode to bundle main and renderer process
[Question] why use library mode to bundle main process
Sep 18, 2024
This plugin uses library mode to bundle the main
and rendererprocess. I wonder what the considerations are.vite-plugin-electron/src/utils.ts
Line 30 in f6dabc3
Firstly, Vite library mode includes opinionated configuration for browser-oriented libraries which may not suitable for the main and renderer processes which are not modules to be imported by other modules.
Secondly, if the output is ESM, it won't be minified (white spaces are kept) in lib mode, which is a long-lived issue of Vite.
In my opinion, directly using rollup to bundle may be a better choice like stated in https://vitejs.dev/guide/backend-integration.html
For example
The text was updated successfully, but these errors were encountered: