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 buildYou are all set, if you check your website you should see alpines is presented in your assets.

That's all.
- Last updated 3 years ago
Be the first to leave a comment.
You must login to leave a comment