Grunt tasks

May 26, 2026 ยท View on GitHub

Grunt tasks

The following Grunt tasks are available after setting up the legacy Grunt development environment.

Please consider using the new UI5 CLI based setup. See the developing OpenUI5 guide for details.

serve

ArgumentDescriptionDefault
modesrc uses source files, target uses built files (see build task)src
portNetwork port to use8080
hostnameNetwork hostname to use (e.g. 127.0.0.1 for local access only)*

Runs an HTTP server.

Maps folders of all libraries

  • src -> /resources
  • test -> /test-resources
grunt serve[:<mode>] [--port=<port>] [--hostname=<hostname>]

# examples
#  grunt serve --port=3000                       # mode=src, port=3000, hostname=*
#  grunt serve --port=3000 --hostname=127.0.0.1  # mode=src, port=3000, hostname=127.0.0.1
#  grunt serve:src                               # mode=src, port=8080, hostname=*
#  grunt serve:target --port=80                  # mode=target, port=80, hostname=*

build

ArgumentDescriptionDefault
libsLibrary name(s) to build (comma-separated)All libraries
productionboolean whether to do a production build (sets default values of minify-css and include-test-resources)false
minify-cssboolean whether to minify css filestrue in production mode, false in non-production mode
include-test-resourcesboolean whether to include test-resourcesfalse in production mode, true in non-production mode

Minifies / compiles / optimizes source files and puts them into target/openui5.

Use serve:target to start a server with the built files (see serve task).

grunt build [--libs=<library-1>,<library-n>] [--production] [--minify-css] [--include-test-resources]

# examples
#  grunt build --production               # build all libraries in production mode (minfied css, no test-resources)
#  grunt build --minify-css               # build all libraries with minified css (but with test-resources)
#  grunt build --libs=sap.ui.core,sap.m   # only build sap.ui.core and sap.m in non-production mode (non-minified css, with test-resources)

docs

ArgumentDescriptionDefault
libsLibrary name(s) to build documentation for (comma-separated)All libraries
default-templateboolean whether to use the JSDoc default template instead of the UI5 templatefalse

Creates documentation from the source files that can be displayed in the SDK. If option default-template is set, HTML output will be generated instead of the api.json files.

grunt docs [--libs=<library-1>,<library-n>]

# examples
#  grunt docs                            # build documentation preview for all libraries
#  grunt docs --libs=sap.ui.core,sap.m   # only build documentation preview for sap.ui.core and sap.m
#  grunt docs --default-template         # produce HTML output using the default JSDoc template

grunt serve

open http://localhost:8080/testsuite/documentation.html#/api