I have added slick.min.js in my custom module in the path below
app/code/company_name/vendor_name/mymodule/view/frontend/web/js/slick.min/js
and my slick initialization js for my template is
require([
'jquery',
'slick'
], function ($) {
$(document).ready(function () {
$(".slider").slick({
autoplay: true,
slidesToShow: 1,
slidesToScroll: 1,
autoplay: true,
autoplaySpeed: 2000,
});
});
});
and added in requirejs-config.js as
var config = {
paths: {
'slick': "xxx_yyy/js/slick.min"
},
map: {
'*': {
slickSlider: 'xxx_yyy/js/slick-slider'
}
},
shim: {
slick: {
deps: ['jquery']
}
},
};
Now it is working except the design. How to add slick.less and slick-theme.less files in custom module?
Best Answer
You can create a '_module.less' file and then call your less files in it.
Add your 'slick.less' and 'slick-theme.less' file under the following directory
Now create '_module.less' file as given below
Then run the deploy command