1

I'm playing with the UI5 minifying and uglifying. As far as I know, there are two common approaches:

  1. Grunt task with gruntfile.cjs, based on grunt-openui5.

  2. UI5 Tooling with ui5.yaml, based on @ui5/cli.

My ui5.yaml:

specVersion: "2.5"
type: application
metadata:
    name: com.myapp
framework:
    name: OpenUI5
    version: 1.95.0
resources:
    configuration:
        paths:
            webapp: src/webapp
builder:
    cachebuster:
        signatureType: hash
    componentPreload:
        namespaces:
            - "com/myapp"
        paths:
            - "src/webapp"

To run the minifying with @ui5/cli, I execute the following NPM-Script task: "test": "ui5 build preload", as the result, I get a brand new dist folder with minified and debug-friendly files (e.g. App.controller.js and App-dbg.controller.js), in addition, Component-preload.js is generated as well.

My questions:

  1. Is Grunt-based approach a legacy, while @ui5/cli is standard approach nowadays?

  2. Is it possible to get a minified version of the UI5 app (just a Component-preload.js) with @ui5/cli without a dist folder?

Mike
  • 14,010
  • 29
  • 101
  • 161
  • Actually it's a little weird because creating a new library, by default, still uses Grunt, but a new application by default uses ui5 cli – Jorg Sep 15 '21 at 01:02
  • @Jorg, I assumed, that Grunt is kind of a legacy but I'm not sure. – Mike Sep 15 '21 at 05:59
  • 2
    According to the [UI5 tooling roadmap](https://github.com/SAP/ui5-tooling/issues/506), [`grunt-openui5`](https://github.com/SAP/grunt-openui5/) is targeted to be replaced by the UI5 tooling. – Boghyon Hoffmann Sep 15 '21 at 18:06
  • @BoghyonHoffmann, BTW, there are `@ui5/cli` and `@ui5/builder`, when should I prefer one over another? – Mike Sep 15 '21 at 18:54
  • 1
    For the consumption of the UI5 tooling, `@ui5/cli` should be installed as intended which [comes with the `@ui5/builder` module](https://github.com/SAP/ui5-tooling#modules). No idea why anyone would choose installing only the sub-modules. – Boghyon Hoffmann Sep 15 '21 at 19:36
  • 1
    _why anyone would choose installing only the sub-modules_ — to not install extra, unwanted modules. – Mike Sep 15 '21 at 19:38

0 Answers0