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 69 forks source link

sap libraries in bundle #841

Closed hauseyo closed 1 year ago

hauseyo commented 1 year ago

Hi, I upgraded ui5 tooling from v2 to v3 and the issue is that sap libraries are included in the final bundle, which is bad in my case because it becomes too heavy. It leads to failed deployment to CF space due to the size of the bundle.

Build result

Expected Behavior

Not having sap libraries in bundle

Current Behavior

Having sap libraries in bundle

Steps to Reproduce the Issue

  1. run ui5 build --a --config ui5-deploy.yaml
  2. check the dist folder

Context

Log Output / Stack Trace

Everything works fine
RandomByte commented 1 year ago

Are you referring to a specific bundle or all the files in the build result?

If you remove the -a flag from your command and after clearing the dist directory, does the result match better with your expectation?

hauseyo commented 1 year ago

Are you referring to a specific bundle or all the files in the build result?

If you remove the -a flag from your command and after clearing the dist directory, does the result match better with your expectation?

Hi, Without --a flag there is no resources folder and jQuery files, which is expectable. But let me be more specific: --a flag is needed because in the project we use 3rd party library, which should be in the final build result. Without it, it will not be included, so we have to use --a flag or find any other way to solve the mentioned issue.

RandomByte commented 1 year ago

I see. In that case, try using the --include-dependency yourlib parameter instead: https://sap.github.io/ui5-tooling/v3/pages/CLI/

hauseyo commented 1 year ago

I see. In that case, try using the --include-dependency yourlib parameter instead: https://sap.github.io/ui5-tooling/v3/pages/CLI/

Yes, I tried that one: ui5 build preload --include-dependency @sapit/sapui5-lib --clean-dest --config ui5-deploy.yaml But it seems, it can't find the dependency, even though it explicitly defined in the package.json

deps in package json Warning
RandomByte commented 1 year ago

You need to specify the name as defined in the library's ui5.yaml (metadata.name)

Check the output of ui5 ls

hauseyo commented 1 year ago

You need to specify the name as defined in the library's ui5.yaml (metadata.name)

Check the output of ui5 ls

Thank you for the hint! It worked. I propose you to somehow document it or add some examples in the documentation.