Title tries to say it al, but it's a tricky construction. I've prepared a M2.3.3 example with the following additions to the core after a clean install including this module and npm i -S requirejs. I've applied changes in the luma theme directory just to setup a simple example without side effects:
define(
[],
function () {
'use strict';
return function (target) {
return target.extend({
defaults: {
TESTETTSTETSTSTTETETSTETSE: '##############################################################'
},
initialize: function () {
this._super();
console.log('init mixin on uiComponent, extended by this:', this);
return this;
}
});
};
}
);
Expected result:
Before running r.js I get a lot of loggin in the console (16) and the example component that extends Magento_Ui/js/lib/core/collection that I check: Magento_Customer/js/view/customer in the header ("Default welcome msg!") show to have the property "TESTETTSTETSTSTTETETSTETSE" upon inspection (with the Knockout context Chrome plugin).
Actual result:
After running r.js -o bundle.js .... I get only 6 log entries in the console (of only plain Magento_Ui/js/lib/core/collection component, not the ones extending it). Also using the same inspection on Magento_Customer/js/view/customer in the header ("Default welcome msg!") does not show the property "TESTETTSTETSTSTTETETSTETSE"
Possible solutions:
I wish I knew, because this method of bundling, the plugin that generates the build.js, is the absolute best and it delivers a great performance boost.
This issue is a:
Environment
node -v
)npm -v
)Description
Title tries to say it al, but it's a tricky construction. I've prepared a M2.3.3 example with the following additions to the core after a clean install including this module and
npm i -S requirejs
. I've applied changes in the luma theme directory just to setup a simple example without side effects:vendor/magento/theme-frontend-luma/web/js/requirejs-config.js
vendor/magento/theme-frontend-luma/web/js/ui-component-mixin
Expected result:
Before running
r.js
I get a lot of loggin in the console (16) and the example component that extendsMagento_Ui/js/lib/core/collection
that I check:Magento_Customer/js/view/customer
in the header ("Default welcome msg!") show to have the property "TESTETTSTETSTSTTETETSTETSE" upon inspection (with the Knockout context Chrome plugin).Actual result:
After running
r.js -o bundle.js ....
I get only 6 log entries in the console (of only plainMagento_Ui/js/lib/core/collection
component, not the ones extending it). Also using the same inspection onMagento_Customer/js/view/customer
in the header ("Default welcome msg!") does not show the property "TESTETTSTETSTSTTETETSTETSE"Possible solutions:
I wish I knew, because this method of bundling, the plugin that generates the
build.js
, is the absolute best and it delivers a great performance boost.