A
A
Alexander Pankov2018-09-15 11:45:50
npm
Alexander Pankov, 2018-09-15 11:45:50

How to include laravel frontend library?

Hello.
how to properly connect third-party plugins when developing on laravel?
i need fullpage.js library
downloaded it via npm
in resources/js/bootstrap.js file i added require('fullpage.js');
in resources/js/app.js file i added

$(document).ready(function () {
    $('.js-fullpage').fullpage({});
});

I run the project and see in the console
app.js:4655 jQuery.Deferred exception: $(...).fullpage is not a function TypeError: $(...).fullpage is not a function
    at HTMLDocument.<anonymous> (http://localhost:3000/js/app.js:770:21)
    at mightThrow (http://localhost:3000/js/app.js:4371:29)
    at process (http://localhost:3000/js/app.js:4439:12) undefined

app.js:770 Uncaught TypeError: $(...).fullpage is not a function

as if he does not see the connection is a library ..
and in general my call code from resources/js/app.js for some reason you are HIGHER than from resources/js/bootstrap.js, although they are connected in a different order

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question