In this tutorial you will learn how to install AlpineJs in laravel 9 and ViteJs.
I am assuming that you have already installed laravel 9 and set it up, now for next step open your
bootstrap.js file in
resources/js folder and paste following lines:
import _ from 'lodash'; window._ = _; import 'bootstrap'; // Add this import Alpine from 'alpinejs'; window.Alpine = Alpine; Alpine.start();
Now build your asset files
npm run build
You are all set, if you check your website you should see alpines is presented in your assets.
- Last updated 5 months ago