i am trying to include slick plugin into magento 2 through custom theme by requirejs but pub/static/_requirejs folder + files are not being generated on code deploy. file structure is following:
- /app/design/frontend/Vendor_Name/Theme_Name/requirejs-config.js
- /app/design/frontend/Vendor_Name/Theme_Name/web/js/slick.js and slick.min.js
- /app/design/frontend/Vendor_Name/Theme_Name/web/css/source/vendor/slick.less and slick-theme.less
Code for requirejs-config.js is as follows:
 `var config = {
 paths: {
 slick:'js/slick'
 },
 shim: {
 slick: {
 deps: ['jquery']
 }
 }
 };`
This is not a duplicate question, i have not found any solution on internet in last two days. Do let me know if any thing else needed regarding this question if it is not clear. I have followed this tutorial: https://inchoo.net/magento-2/magento-2-slick-carousel/
but i am stuck on point 7 as "requirejs-config.js" is not getting included may be because pub/static/_requirejs folder is not being generated on deploy
php bin/magento setup:static-content:deploy -f
Please help me as i am stuck on this issue from last 2 days
Screenshot of View-source is: View-source of head block
- 
 deploy command generates pub/static/frontend, pub/static/adminhtml folders and their needed files but not _requirejs folderAsad Kaleem– Asad Kaleem2018年07月08日 14:10:18 +00:00Commented Jul 8, 2018 at 14:10
- 
 _requirejs folder creates on magento 2 lower version i.e. on 2.1.x but not on Magento 2.2.xSukumar Gorai– Sukumar Gorai2018年07月09日 09:12:53 +00:00Commented Jul 9, 2018 at 9:12
- 
 then how should I add 3rd party custom plugins in magento 2.2.x through require.js or any other way?Asad Kaleem– Asad Kaleem2018年07月09日 13:38:49 +00:00Commented Jul 9, 2018 at 13:38
- 
 Do you want to add external js to your website?Sukumar Gorai– Sukumar Gorai2018年07月09日 13:39:23 +00:00Commented Jul 9, 2018 at 13:39
- 
 yes.. like slick carousel, scroll bars or any other pluginsAsad Kaleem– Asad Kaleem2018年07月09日 13:40:12 +00:00Commented Jul 9, 2018 at 13:40
1 Answer 1
You need to check the if requirejs-config.js loads slick or not on below path:
pub/static/frontend/vendor/theme/requirejs-config.js
If its exist there then check the page by view source if its loads the same there or not on below path:
http://example.com/pub/static/version1531144264/frontend/vendor/theme/en_US/requirejs-config.js
It should load there but according to the screenshot you have shared, requirejs-config.js is not loaded on your browser that means either you have created new layout which removed the block or you have removed some block which add requirejs to the page.
You can debug it by enabling luma theme and also disabled the other customization you have made.
Hope this helps!
Explore related questions
See similar questions with these tags.