How to Migrate from Laravel Mix to Vite
Laravel creates an admin panel from scratch — Part 14
5 min readJul 3, 2022
The laravel team announced that Vite is now the default frontend asset bundler. Also, the Laravel team launched the official vite-plugin
Why Vite
Vite is a new breed of frontend build tool that provides an extremely fast development environment and bundles your code for production. The official why vite document has in-depth details.
Migrating from Laravel Mix to Vite
We going to migrate our Basic admin panel from Laravel Mix to Vite. The migration involved the below steps. The official Laravel Vite plugin includes an in-depth migration guide.
- 1. Install Vite and the Laravel Plugin
- 2. Configure Vite
- 3. Update NPM scripts
- 4. Replace
require
toimport
- 5. Update environment variables
- 6. Replace
mix()
with@vite