Skip to main content
3 of 3
Corrected spelling, fixed grammer and formatted link
Yash Shah
  • 2.5k
  • 1
  • 10
  • 17

Both does the same thing, while a map has an additional advantage to create an alias for entire Magento or a specific module.

Path does not have that advantage. It will consider for the entire Magento.

In your code,

var config = {
    map: {
        '*': {
            'jqueryjs': 'India_Newtheme/js/jquery',
            'bootstrapmin': 'India_Newtheme/js/vendor/bootstrap.min'
        },
        'MyVendor_MyModule': {
            'jqueryjs': 'MyVendor_MyModule/js/jquery',
        }
    },
    paths: {            
        'jqueryjs': 'India_Newtheme/js/jquery',
        'bootstrapmin': 'India_Newtheme/js/vendor/bootstrap.min'
    }
};

If you are defining something in "*" within map, it will consider for entire Magento, but if the same thing you define within some module name, in our case MyVendor_MyModule whenever the same alias jquery will be called within your module js file, it will call MyVendor_MyModule/js/jquery instead of India_Newtheme/js/jquery.

Hope this helps.

Yash Shah
  • 2.5k
  • 1
  • 10
  • 17