I try to mixin
a widget js file following guide at here. I create a file requirejs-config.js
in view/frontend
directory. There’s view/frontend/requirejs-config.js
:
var config = { config: { mixins: { 'mage/dataPost': { 'Vendor_Training/js/dataPost-mixin': true } } } };
And there’s view/frontend/web/js/dataPost-mixin.js
:
define([ 'jquery' ], function($ ) { console.log('Mixin Working'); return function (dataPost) { return dataPost; }; });
And it’s exist on pub/static/frontend/<Vendor>/<theme>/en_US/requirejs-config.js
. But it’s not working.
And it’s working when I use map
on requirejs-config.js
to override.
The mixins js file not calling when dataPost.js
run.
Any help would be appreciated.