Check the following code in vendor/module-theme/view/frontend/requirejs-config.js
var config = {
map: {
"*": {
"rowBuilder": "Magento_Theme/js/row-builder",
"toggleAdvanced": "mage/toggle",
"translateInline": "mage/translate-inline",
"sticky": "mage/sticky",
"tabs": "mage/tabs",
"zoom": "mage/zoom",
"collapsible": "mage/collapsible",
"dropdownDialog": "mage/dropdown",
"dropdown": "mage/dropdowns",
"accordion": "mage/accordion",
"loader": "mage/loader",
"tooltip": "mage/tooltip",
"deletableItem": "mage/deletable-item",
"itemTable": "mage/item-table",
"fieldsetControls": "mage/fieldset-controls",
"fieldsetResetControl": "mage/fieldset-controls",
"redirectUrl": "mage/redirect-url",
"loaderAjax": "mage/loader",
"menu": "mage/menu",
"popupWindow": "mage/popup-window",
"validation": "mage/validation/validation",
"welcome": "Magento_Theme/js/view/welcome"
}
},
paths: {
"jquery/ui": "jquery/jquery-ui"
},
deps: [
"jquery/jquery.mobile.custom",
"js/responsive",
"mage/common",
"mage/dataPost",
"js/theme",
"mage/bootstrap"
]
};
2) They have specified the name "menu" for "mage/menu.js"
3) Write below content in your module's requirejs-config.js
var config = {
map: {
'*': {
"menu": "Companyname_Modulename/js/menu",
}
},
};
4) Copy menu.js in your module to the path specified in requirejs.
Let me know if you have any further question.
Firstly, you need to make sure, that your module has Magento_ConfigurableProduct
in sequence in module.xml
:
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Vendor_ModuleName" setup_version="1.0.0">
<sequence>
<module name="Magento_ConfigurableProduct"/>
</sequence>
</module>
</config>
Make sure to regenerate the component list in config.php
, otherwise the sequence will be ignored (http://devdocs.magento.com/guides/v2.2/extension-dev-guide/build/module-load-order.html)
Then add requirejs-config.js
file in view/frontend
directory with code:
var config = {
map: {
'*': {
configurable: 'Vendor_ModuleName/js/configurable'
}
}
};
Finally add configurable.js
file in view/frontend/web/js
directory with:
define([
'jquery',
'priceUtils',
'jquery/ui',
'Magento_ConfigurableProduct/js/configurable'
], function($, priceUtils){
$.widget('silvan.configurable', $.mage.configurable, {
//code you want to override
});
return $.silvan.configurable;
});
You can't modify a single line, but you can modify a single function inside.
Best Answer
If it's usefull to someone, i have made this changes and it worked:
file: /app/design/adminhtml/<'vendor'>/<'theme'>/requirejs-config.js
file: app/design/adminhtml/<'vendor'>/<'theme'>/web/js/custom_tinymce_setup.js
I called de js from the /app/code/<'vendor'>/<'module'>/view/adminhtml/templates/page/header.phtml file. before the end of file:
Just have to add the es.js files to lib/web/tiny_mce/themes/advanced/langs and lib/web/tiny_mce/langs/
Thanks!