Join the Stack Overflow Community
Stack Overflow is a community of 6.8 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

I'm unable to get JQuery UI required when using Laravel Elixir with Webpack.

Here is my gulpfile.js, nothing unusual:

const elixir = require('laravel-elixir');

elixir.config.sourcemaps = false;

elixir(mix => {
    mix.sass('app.scss')
       .webpack('app.js');
});

My app.js file is where I'm trying to require both JQuery and JQuery UI. I've tried multiple things but this is where I'm at:

window.$ = window.jQuery = require('jquery');
window.$ = $.extend(require('jquery-ui'));

No matter what I do, I can't seem to get JQuery UI required and working.

share|improve this question
    
did you ever figure this out???? – Alan Asher Nov 26 '16 at 20:54
    
Was this ever resolved? – Jake Sylvestre Dec 10 '16 at 21:01
up vote 1 down vote accepted

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!

share|improve this answer
    
how about css? its not working – Jagadesha NH Jan 28 at 18:35
    
@JagadeshaNH are you using elixir for that too? – Jake Sylvestre Jan 30 at 1:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.