ui5-tooling icon indicating copy to clipboard operation
ui5-tooling copied to clipboard

Provide and document options to reduce content of build result

Open matz3 opened this issue 6 years ago • 6 comments

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:

  • All locale/language-specific files (CLDR, messagebundle_*.properties)
  • All themes (incl. RTL-variants)
  • Individual JS files that are part of a bundle (e.g. sap-ui-custom.js / library-preload.js / Component-preload.js)

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

  • via API excludedTasks: ["createDebugFiles"]
  • or via CLI option --exclude-task=createDebugFiles

Context

  • UI5 Module Version (output of ui5 --version when using the CLI): 0.2.6

Affected components (if known)

matz3 avatar Dec 04 '18 15:12 matz3

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.

miffels avatar Dec 05 '18 14:12 miffels

@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

jrondorf avatar Apr 03 '19 11:04 jrondorf

@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

matz3 avatar Apr 03 '19 12:04 matz3

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

jrondorf avatar Apr 03 '19 12:04 jrondorf

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

RandomByte avatar Apr 20 '20 16:04 RandomByte

Hi @RandomByte,

was the Documentation improved already in this direction?

CU Gregor

gregorwolf avatar Oct 27 '21 05:10 gregorwolf