Limitations of portlet bundling - liferay/liferay-js-toolkit GitHub Wiki
:warning: The contents of this wiki have been migrated to the
liferay/liferay-frontend-projects
monorepo and more specifically to the to themaintenance/projects/js-toolkit/docs
directory. Development and updates will continue there, and this repo will be archived (ie. switched to read-only mode).
The JS Toolkit bundler tries to behave as much as it can like webpack
Dynamic require/import are not supported
This comes from issue 588.
The problem is that the current architecture cannot resolve dynamic modules because of limitations when the server analyzes the dependency graph and because of the use of the AMD specification which executes the define()
call once and for all, making it it impossible to make a module depend on different dependencies depending on runtime values.