0

I am trying to overwrite some methods from my original js file.

My original file path is:

app/code/vendor/theme/view/base/web/js/file.js.

In my file-mixin.js file I want override few things from file.js at below location:

app/code/vendor/theme/view/base/web/js/file-mixin.js.

My requirejs-config.js

app/code/vendor/theme/view/base/requirejs-config.js

var config = {
'config':{
    'mixins': {
        '<Vendor>_<Theme>/js/file': {
            '<Vendor>_<Theme>/js/file-mixin': true
        }
    }
};

My file-mixin.js

define([
"jquery",
"jquery/ui"
], function ($) {

$.widget('mage.something', {
    _create: function () {
      // Content goes here
    }
});

return $.mage.something;
});

The problem is, my file-mixin.js overwrites all my file.js, it looks like file-mixins.js does not inherit any thing from file.js (or don't even see file.js)

Any one know how can I fix problem with this one?

Your Answer

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

Browse other questions tagged or ask your own question.