Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-115467

Allow consuming NPM-module from another OSGi-module without relying on full path

    Details

      Description

      Hello Team,

      As discussed internally: currently, it is possible to import an NPM module from another OSGi module by providing the full path, e.g.:

      .npmbundlerrc:

      ...
      	"config": {
      		"imports": {
      			"mylib.npm.vue.portlet": {
      				"/": "^1.0.0"
      			}
      		}
      	},
      ...
      

      And then e.g. in index.js of mylib.npm.query.portlet:

      import funcUtils from 'mylib.npm.vue.portlet/lib/mylib-functions-utils';

      The proposal is that, in Workspace, it should be possible to import the module even without relying on the full path, for example, simply:

      import funcUtils from 'mylib-functions-utils'

      This would allow require updating all consumers when the path of a lib is changed or moved to another osgi-module. In the same way, it should be possible to address own js-libs from other portlets without having to know the full-path, the version, etc., in the same way e.g. Liferay does through Liferay.Loader.require call with these params:

      "metal-dom/src/all/dom", "clay-tooltip/src/ClayTooltip"

        Attachments

          Activity

            People

            Assignee:
            lawrence.lee Lawrence Lee
            Reporter:
            alfonso.crisci Alfonso Crisci (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Packages

                Version Package