Affects Version/s: Master
Component/s: AMD Module Loader
The NPMRegistry has a mapModuleName() function which is used to convert module names to their real path. For example, if you write:
It will translate it to something like:
Provided that the main module of "a-package" is defined as "./lib/index".
This has worked without problems for so long, but there's a case where it fails. Say you have "./lib" as the main module of "a-package", and then you have and "index.js" file inside "lib". That should make
be converted to:
But, because mapModuleName() is not calling itself recursively, it only does one mapping, when two are required: the first one to map "a-package" to "a-package/lib", and the second one to map "a-package/lib" to "a-package/lib/index".
Steps to reproduce:
1) Download or clone the repo at https://github.com/Gympass/poc-liferay-react
2) Run "npm install" in that project
3) Run "npm build" in that project
4) Deploy the JAR file in the "dist" folder of the project
5) Open the site in a browser and add the "gympass" portlet to the home page
1) The portlet is rendered (a button appears)