Laravel, Vue and Inertia with Vite

Photo by Ben White on Unsplash

But first… some shameless self promotion

Also, a shout out

Into the fray…

Before you begin

First steps

webpack.mix.js
resources/views/welcome.blade.php
composer require inertiajs/inertia-laravel
yarn add @inertiajs/inertia @inertiajs/inertia-vue3 vue@next vite @vitejs/plugin-vue @vue/compiler-sfc autoprefixer@latest postcss@latest tailwindcss@latest --dev
npx tailwindcss init -p
@tailwind bade;
@tailwind components;
@tailwind utilities;
purge: [
'./resources/js/**/*.{vue,js}',
'./resources/views/**/*.blade.php'
],

Vite Configuration

npx vite build// ornpx vite serve
Running vite dev server

Valet

npx vite serve --host=mysite.test

Scripts

yarn dev
yarn prod

Laravel and Inertia

One last stab at some self promotion

composer require thepublicgood/vitaminphp ./artisan vitamin:init

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store