SAP / ui5-tooling

An open and modular toolchain to develop state of the art applications based on the UI5 framework
https://sap.github.io/ui5-tooling
Apache License 2.0
465 stars 71 forks source link

Provide and document options to reduce content of build result #361

Open matz3 opened 5 years ago

matz3 commented 5 years ago

Expected Behavior

When executing a build, a lot of files are written to the dist folder that might not be required at runtime, such as:

This is relevant when packaging the app e.g. with Cordova, as the application bundle can become quite large. It also speeds up deployment e.g. when uploading the files to a server.

It would be helpful if a project could declare/define which locales/languages/themes should be supported. By default all variants should be used.

Current Behavior

It is currently only possible to exclude -dbg.js files

Context

Affected components (if known)

miffels commented 5 years ago

Background is a Cordova build I made using the basic template app as web content. These are the results of ui5 build self-contained --dest www --all --exclude-task=createDebugFiles

This is an overview by file type - you can see that 65% of the build is just JSON, CSS and .properties files.

Size by file type

Digging deeper it becomes apparent that most of this is related to localization, themes and RTL/LTR layouts.

Visualization

The other thing is that many of the js files are redundant with the sap-ui-custom.js built this way, and ideally those bundled files would be removed. Files not bundled this way are probably dead weight, too, if the intention is to bundle everything declared by the app.

jrondorf commented 5 years ago

@matz3 Hi Matthias, is it possible to specify excludedTasks: ["createDebugFiles"] in ui5.yaml file ?

This does not work:

specVersion: '1.0'
metadata:
  name: ui5_compile
type: application
builder:
  excludedTasks: 
    - createDebugFiles
matz3 commented 5 years ago

@jrondorf my example was related to the API. When using the CLI this needs to be passed as option on the command line (--exclude-task=createDebugFiles), e.g:

ui5 build self-contained --all --exclude-task=createDebugFiles
jrondorf commented 5 years ago

@matz3 Thanks, this works fine. Grüße, Jannis

RandomByte commented 4 years ago

Possible task for us: Document options to reduce size of build results

gregorwolf commented 2 years ago

Hi @RandomByte,

was the Documentation improved already in this direction?

CU Gregor