Skip to content

Magento 2 how to avoid loading of certain js files on checkout page via requirejs?

I want to load certain js files on all pages except checkout page.
How can I add a condition in requirejs-config.js file not to load js files when user is on checkout page?

In the code below, I want to be able to know if the user is on checkout page.

var checkout = true;

if (!checkout) {
    config.map['*'] = {
        product: 'Vendor_Module/js/product',
        pincode: 'Vendor_Module/js/pincode'
    };
}