I want to override following js core file.


I have tried in my custom theme as follow but it is not working


i have also created required requirejs-config.js and added following code


var config = {
    map: {
        '*': {
            configurable: 'Magento_ConfigurableProduct/js/configurable'

Need to run :

rm -rf var/generation/ var/view_preprocessed/ pub/static/frontend/ pub/static/_requirejs/ var/cache var/di var/page_cache pub/static/_cache

./bin/magento setup:static-content:deploy


If you want to override at theme level then don't need anything. Donot require requirejs-config.js at app/design/frontend/TemplateMonster/theme007/Magento_ConfigurableProduct/requirejs-config.js

Just put configurable.js at app/design/frontend/TemplateMonster/theme007/Magento_ConfigurableProduct/web/js.Means file name should same with core file and same location.

After that do Static content deploy.It must required.


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">
            <module name="Magento_ConfigurableProduct"/>

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:

], function($){

    $.widget('silvan.configurable', $.mage.configurable, {
        //code you want to override

    return $.silvan.configurable;

Run this Commands :

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
php bin/magento cache:flush

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.