on ‎2021 Jul 26 12:49 PM
Dear Experts,
I want to use common libraries (Controller, i18n etc ...) in BAS development. However, I'm in trouble because I don't know how to do it.
Regards,
rinn.
Request clarification before answering.
Hi,
If you already have the application and the reuse library you can have 2 options currently.
1. Where you only want to change the application code.
In this case if the reuse library has been deployed to the backend system to the UI5 Application Index it will be loaded automatically using startup of the application preview (assuming it includes the file `webapp/utils/locate-reuse-libs.js`). The library must also be referenced in the manifest.json of the application in the `libs` section.
2. Where you want to modify the reuse library code.
clone both the application and the reuse library to the workspace.
Link the reuse library to the application via the command palette command "Add Reference to SAP Fiori Reusable Libraries". Then follow the wizard steps. Then during application preview the resuse library will be served from the workspace.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This may occur in case the description in the manifest or i18n is missing. This will be fixed in the next release.
E.g. manifest['sap.app'].description
This wizard creates the entries Marian mentions in https://answers.sap.com/answers/13449154/view.html
Also, there is further documentation available for these options at https://www.npmjs.com/package/@sap/ux-ui5-tooling#3-serve-static
If you are stilling having problems with the wizard please create a customer support issue and send it to component CA-UX-IDE and attach a zip with the re-use library.
We had the same problem.
We also transferred from WebIDE and the solution was relatively simple, to use the library from within your workspace:
Of course, the library must be referenced in the manifest.
Also, in your ui5.yaml an additional item under:
server:
customMiddleware:
- name: fiori-tools-servestatic
afterMiddleware: compression
configuration:
paths:
- path: /resources/namespaceoflibrary
src: /home/user/projects/librarynfolderame/pointtolibraryjs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry for the late reply.
It was helpful while searching for a way to achieve it. thank you.
I'm sorry I couldn't make it the best answer ...
But I really appreciate it!
Hi
In BAS there is no template.
What is your runtime environment? CF/ABAP?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.