Open bardt opened 9 years ago
Here is an example code, which will break after minification:
myOwnPrivateModule.js
---
function translate(text, $i18n) {
return $i18n._t(text);
}
module.exports = function(slot, $regionManager, $i18n, $appState) {
return { ....... }
}
App
invoke
method have some limitations on usage with code minification such as uglify.js. Internally, it only instruments first function in module, satisfying some requirements. The instrumentation itself is adding an array of argument-to-inject names intomodule.exports._args
. If some function requirements are not met, code will work until it is minified. So, there is inconsistency betweendevelopment
andproduction
use cases.We need to do one of the following:
invoke
method