Skip to content

Replace webpack with vite#534

Merged
Palbolsky merged 9 commits intodevelopfrom
replace-webpack-by-vite
Jul 11, 2025
Merged

Replace webpack with vite#534
Palbolsky merged 9 commits intodevelopfrom
replace-webpack-by-vite

Conversation

@Palbolsky
Copy link
Collaborator

@Palbolsky Palbolsky commented Jun 23, 2025

Description

This PR replaces webpack with vite to improve application launch performance for developers. 🚀
Many changes have been made, but they can easily be categorised as follows:

  • vite configuration: define the entries points of the application (main, preload and renderer), plugins and adujstment for the production
  • remove webpack
  • svg support (many imports to update)

Hot reload for the front end is functional, but not for the backend. For this to work in the backend, you would need to use electron-vite. But we use electron-forge with a vite plugin because we used electron-forge with webpack plugin.
Reloading for the backend didn't work with webpack either, so there's no regression.

The update system and psdk-binaries depends on electron-forge, so there are no problems to worry about.

Closes #527

After merging this PR, you can delete the .webpack folder at the root of the project.

Performances gained

Dev environment (tested with i7-10700K and 32 GB ram) :

  • webpack: 22 sec (+57 %)
  • vite: 14 sec

CI (github) :

  • webpack: ~3mn 30 (+40%)
  • vite: ~2mn 30

Possible improvements

In dev, the time taken to launch the application depends enormously on the application's front-end (parsing, etc.).

I've done some tests with react lazy and I can launch the application in 10 seconds. But this results in short loading times in the application (which is normal), but much less noticeable in production.

So there's a balance to be struck to avoid impacting users. For this reason, I prefer to take the time to find a good compromise, but we can already merge this PR to already gain in performance.

Tests to perform

  • The application starts correctly and works correctly
  • The application can be packaged and works in production

@Palbolsky Palbolsky self-assigned this Jun 23, 2025
@Palbolsky Palbolsky added the Technical story Issues related to technical work label Jun 23, 2025
@Palbolsky Palbolsky force-pushed the replace-webpack-by-vite branch 2 times, most recently from c97aca6 to 6117019 Compare July 1, 2025 14:35
@Palbolsky Palbolsky force-pushed the replace-webpack-by-vite branch from 2536449 to 8e189ae Compare July 8, 2025 12:45
@Palbolsky
Copy link
Collaborator Author

J'ai testé la migration sur Linux et j'ai trouvé un bug que j'ai corrigé. Il faudrait s'assurer que tout est OK sur mac.

Copy link
Collaborator

@AerunDev AerunDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'ai testé la plupart des fonctionnalités sur Windows, et tout semble bien plus fluide ! Le lancement en mode dev, la chargement des pages, le build avec npm run make également.
J'ai testé de créer un paquet et de le lancer, aucun problème également.

Bien joué, pour moi c'est validé ! 💪

@Palbolsky
Copy link
Collaborator Author

@pw-rey a validé le fonctionnement sur mac donc un dernier approuve et on peut merge :)

@Palbolsky Palbolsky force-pushed the replace-webpack-by-vite branch from 8e189ae to f947006 Compare July 11, 2025 20:55
@Palbolsky Palbolsky merged commit d67fcbd into develop Jul 11, 2025
5 checks passed
@Palbolsky Palbolsky deleted the replace-webpack-by-vite branch July 11, 2025 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Technical story Issues related to technical work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace webpack by vite to improve the app performances

4 participants