ui5-tooling
ui5-tooling copied to clipboard
Improve JSModuleAnalyzer to support local names for dependency detection
Is your feature request related to a problem? Please describe.
Currently, the UI5 Tooling is not able to detect all dependencies of a JavaScript module when it analyzes the code.
When using local names for certain APIs, such as jQuery.sap.require or sap.ui.require, the calls are not recognized and the dependencies are not detected.
Describe the solution you'd like
The underlaying JSModuleAnalyzer (part of ui5-builder) should be improved in a way that allows recognition of the known APIs in case they are using a local variable name.
Describe alternatives you've considered
Additional context
One example (there are many more use cases)
Dependency to my/module.js is detected
sap.ui.define(["jquery.sap.global"], function() {
jQuery.sap.require("my.module");
});
Dependency to my/module.js is NOT detected
sap.ui.define(["jquery.sap.global"], function(jq) {
jq.sap.require("my.module");
});