inertiajs.com icon indicating copy to clipboard operation
inertiajs.com copied to clipboard

Add instructions for Laravel Vite

Open JusstPaul opened this issue 3 years ago • 2 comments

As Laravel 9.x onwards, vite has replaced mix as the default asset bundler. Setting up instructions on how to setup a new Laravel Inertia project from scratch would be incredibly helpful for people who do not want to start with templates.

I'm also interested in working on this but I want to know how this project wants to implement this first. Thank you.

JusstPaul avatar Oct 24 '22 11:10 JusstPaul

Yes I keep setting up new projects only to find a blank screen until I found out I should replace

 <link href="{{ mix('/css/app.css') }}" rel="stylesheet" />
 <script src="{{ mix('/js/app.js') }}" defer></script>

With

@vite('resources/js/app.js')
@vite('resources/css/app.css')

MarkSemaan avatar Oct 30 '22 17:10 MarkSemaan

@MarkSemaan are you using .js extension on your project? can you share how you setup your app.js as I am having error build on it

kevinpallado avatar Jun 29 '23 16:06 kevinpallado