-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preload bundles do not support modules defining global variables #438
Comments
After looking deeper into it, this is a bit different than originally expected. The builder already can handle modules with global vars correctly and it contains code to identify them. But in case raw module info is maintained in The raw module info has been given priority over the analysis step when support for standard AMD APIs was added (I can't reference the corresponding commit as this was implemented in an internal repo before going open source. But the code is here). The analysis of standard AMD bundles caused issues when the embedded modules are not available to the UI5 tooling. This approach should be revised so that the raw-module info and the analysis results can be merged again. This will fix the issue reported here. |
Hey @codeworrior! Thanks for the in-depth analysis and the quick solution, as always! =) Looking forward of this beeing merged! I tried building with the fix you submitted and got quite a verbose log output (I'll send it to you the logs privately, as they contain some internal information). Hope this helps! Thanks again! |
…os (#340) [FIX] Bundling: merge dependency analysis results with raw module infos Fixes https://github.com/SAP/ui5-builder/issues/338 Also adds tests for Resolver
In case a module is defining a variables in global scope, such as (only a selection):
Building a preload bundle will result in the variables not be defined on global scope any longer, as the preload generation will wrap the module into a function itself, thus rendering the globally defined vars as function scoped vars instead.
Expected Behavior
Building a preload bundle with a depdendency to e.g. sap/ui/thirdparty/require should still expose requirejs, require and define on global scope, just like loading the application w/o a preload bundle.
Current Behavior
Global variables are not exposed, this could lead to side effects with other modules.
Context
1.5.1
Affected components (if known)
The text was updated successfully, but these errors were encountered: