Interface JSBundleProcessor


public interface JSBundleProcessor
Processes an OSGi bundle to find NPM packages and modules inside it and make them available for the NPMRegistry to track them.

There can be several JSBundleProcessors deployed inside one portal if necessary. This allows the deployment of OSGi bundles with different structures containing the NPM packages.

By default, the portal is bundled with a default JSBundleProcessor implemented by com.liferay.frontend.js.loader.modules.extender.internal.npm.flat.FlatNPMBundleProcessor, which looks for NPM packages inside the META-INF/resources/node_modules folder.

  • Method Summary

    Modifier and Type
    Method
    Description
    process(org.osgi.framework.Bundle bundle)
    Returns a JS Bundle filled with the description of the NPM packages or modules found in the given bundle.
  • Method Details

    • process

      JSBundle process(org.osgi.framework.Bundle bundle)
      Returns a JS Bundle filled with the description of the NPM packages or modules found in the given bundle. If the given bundle does not contain an NPM package or module, this method returns null.

      This method is invoked by the NPMRegistry whenever a new OSGi bundle is deployed to the portal.

      Parameters:
      bundle - the handle to the OSGi bundle being deployed
      Returns:
      the valid bundle descriptor or null if no NPM packages or modules were found