3

I'm new to RequireJS and trying to figure out why this is happening. I have a custom file stickyNav.js in <vendor>/<theme>/web/js.

I've added a requirejs-config.js file in <vendor>/<theme>/web/.

var config = {
     map: {
         '*' : {
             'stickyNav': 'js/stickyNav'
         }
     }
 };

This is my js code (to call console.log as a test)

define([
    'jquery',
    'jquery/ui',
    'stickyNav'], function($, stickyNav){
        console.log('Working');
    }
 );

Obviously I have this wrong. I read the official doc's, but i'm still struggling.

Your Answer

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

Browse other questions tagged or ask your own question.