Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Using Vite with Laravel

Hiren Dave
January 27, 2022

Using Vite with Laravel

Using Vite with JavaScript Heavy Laravel project
Remove Laravel Mix dependencies
Install Vite
Add Vite config

Hiren Dave

January 27, 2022
Tweet

More Decks by Hiren Dave

Other Decks in Technology

Transcript

  1. What is Vite • A build tool for faster and

    better development experience for web apps • Serves native ES modules transpired with ESBuild • For production builds it uses Rollup to bundle assets • Some features of Vite • Instant Server Start • Fast HMR • Support for TypeScript, JSX etc. • Optimized build with Rollup • Fully typed APIs
  2. What are the problems with existing tools? • Slow start

    of dev server • Slow file updates • Slow HMR • Long build time
  3. Features of Vite • Dependency resolving and prebuilding • HMR

    • Typescript support • Support from Vue • Support for JSX • Dealing with CSS • Static assets • Glob Import • Build Optimizations
  4. Using Vite with Laravel • Using Vite with JavaScript Heavy

    Laravel project • Remove Laravel Mix dependencies • Install Vite • Add Vite config