A
A
Andrew2019-09-30 22:23:42
PHP
Andrew, 2019-09-30 22:23:42

How to include owl carousel in gulp project?

Good evening, tell me how to connect the owl carousel plugin that was installed via npm
to the project?
I use gulp, namely the optimizedhtml 5 build
. Thanks in advance.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
gian_tiaga, 2019-10-01
@gian_tiaga

Gulp has nothing to do with it at all. You need to connect the script to yourself in js, for example, via require, and galp will collect it all

A
AlexeyL1t, 2021-03-11
@AlekseyL1t

I myself suffered with this for a long time, in the end you need to add fn to the carousel

import $ from 'jquery'
window.jQuery = $
window.$ = $

let owl_carousel = require('owl.carousel');
window.fn = owl_carousel;

$(document).ready(function(){
  $('.owl-carousel').owlCarousel();
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question