0

I created a custom theme which is inheriting from the blank theme.
Now I wanted to integrate Slick and found this article which I followed
https://inchoo.net/magento-2/magento-2-slick-carousel/

My problem:
I pasted this to a freshly created app/design/frontend/_YOUR_VENDOR_/_YOUR_THEME_/web/requirejs-config.js

var config = {
    paths: {
        slick:        'js/slick'
    },
    shim: {
        slick: {
            deps: ['jquery']
        }
    }
};

Now when I check the file on the web page this is the only content in it, of course because it's obviously overriding the file from the parent theme

I could copy paste the content of the parent theme's requirejs-config.js
but then still if the parent theme gets updated I will not get those updates.

How can I just extend the file instead of overriding?
Or is there a better way to integrate the js library?

  • what is the issue bro? – sarvesh Dineshkumar Patel Apr 2 at 11:20
  • The issue is what I posted in my question. What's not clear? Can you be more specific? When I create a requirejs-config the way I described then it obviously overrides the requirejs-config which is inherited from the parent. I dont want that to happen. I want to keep the contents of the original requirejs-config and extend it with my custom requirejs-config – Chaz Apr 2 at 16:40
  • share your code – sarvesh Dineshkumar Patel Apr 3 at 5:27
0

It seems like using this path

app/design/frontend/_YOUR_VENDOR_/_YOUR_THEME_/requirejs-config.js

instead of

app/design/frontend/_YOUR_VENDOR_/_YOUR_THEME_/web/requirejs-config.js

placing the file in the theme root instead of the web subfolder, solves my issue.

Maybe someone can give me some insight on why this is the case, and why or under what circumstances you would want to follow the Inchoo tutorial and put the file in the web subfolder then.

But for now this seems to work.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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