In our custom module, we have pages similar to the order page. We need some changes in the scripts.js file only in those custom module pages. Following is the core file we are using is
module-sales/view/adminhtml/web/order/create/scripts.js .
In order to override we added requirejs-config.js in the following location
app/code/[Namespace]/[Module]/view/adminhtml/requirejs-config.js
with the following content
var config = {
map: {
'*': {
'Magento_Sales/order/create/scripts': 'Namespace_Module/js/scripts',
}
}
};
We copied the scripts.js file in the custom file scripts.js in the following location
Namespace/Module/view/adminhtml/web/js/scripts.js
The custom module pages are working as we expected. But the modifications are affecting not only in custom module pages but also in the Magento pages also.
Please, can anyone help?