Gulp

Both the Angular and React portlet projects generated by Jetray rely on a single master gulpfile (gulpfile.js) to execute build and deployment tasks. While the specific implementation of the various tasks obviously varies between the frameworks the intent is that the set of tasks (and the general purpose associated with each task) is consistent across all framework implementations.

The major tasks provided by a Jetray gulpfile are listed in the table below:

Task Description
clean Removes all existing content from both the build and dist subdirectories
build Invokes webpack (dev mode) to perform application transpilation/bundling and copies any required resources. The net effect of the task is to ensure that all required runtime artifacts are created/copied in the build subdirectory.
prod Performs the same operations as the build task, except that it invokes webpack with the production-mode configuration
jar Collects all artifacts from the build subdirectory, creates a Liferay DXP compatible JAR file, and places that JAR file in the dist subdirectory. This task uses custom JavaScript code in the _libs subdirectory, and uses Liferay-specific configuration files from the _liferay subdirectory. Also, this task accepts certain configuration options in the gulpfile to control some aspects of the JAR file creation
deploy Deploys a previously created Liferay DXP compatible JAR file from the dist subdirectory into the Liferay server environment
watch Effectively executes the build, jar, and deploy tasks in an repetitive loop facilitating rapid iterative development in a style that is familiar to npm-toolchain based development. This task generally uses webpack in “watch mode” so it tends to be very quick and efficient for development.