-
Type:
Feature Request
-
Status: Closed
-
Priority:
Minor
-
Resolution: Duplicate
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Dev Tools > Workspace
-
Labels:
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"