Laravel Elixir with JQuery and JQuery UI
Figured it out. jquery-ui, as is built and in npm
doesn't contain a dist file. In order to solve this you have to use a file called jquery-ui-bundle
. Run the following command npm i -S jquery-ui-bundle
.
Then require it after jquery
require('jquery');require('jquery-ui-bundle');
Hope this saves someone some time, I spent a few hours figuring that out!
npm install jquery-ui-bundle --save
In your bootstrap.js add this:
window.$ = window.jQuery = require('jquery');window.$ = $.extend(require('jquery-ui-bundle'));
npm run dev
Three simple steps:
Install npm package:
npm i -S jquery-ui-bundle
Import javascript (somewhere after jquery importing):
require('jquery-ui-bundle');
- Import css styles:
node_modules/jquery-ui-bundle/jquery-ui.css