I have a file: etc/adminhtml/system.xml
where I have added some form fields. However I need to add a custom script being executed while someone types in one of the fields.
How can I include a .js in this page? It appears I can't simply include it like I would do in a simple xml magento 2 page
<head>
<css src="Vendor_Module::test.css"/>
<link src="Vendor_Module::test.js"/>
</head>
requirejs-config.js
(I posted it as a reply below). However in my case I wish to include the .js file only in the system page of my module, not in every single page of the admin panel. Any ideas on that?view/adminhtml/layout/adminhtml_system_config_edit.xml
that was suggested in the first reply didn't work... I keep searching thoughview/adminhtml/requirejs-config.js
with my own code inside and it seems to be loaded in every single page of the admin panel. I don't like this practice, but it's the only thing working right now. I also get this error:Uncaught ReferenceError: config is not defined at requirejs-config.js:423 at requirejs-config.js:424 at requirejs-config.js:428 (anonymous) @ requirejs-config.js:423 (anonymous) @ requirejs-config.js:424 (anonymous) @ requirejs-config.js:428