Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Reuse" library support? #24

Open
nils opened this issue Jan 9, 2024 · 1 comment
Open

"Reuse" library support? #24

nils opened this issue Jan 9, 2024 · 1 comment

Comments

@nils
Copy link
Contributor

nils commented Jan 9, 2024

Hi @geert-janklaps,

I have a "reuse library" in my project, and I'm using cds-launchpad-plugin in combination with cds-ui5-plugin.

Now when I want to to use a resource MyResource from my.namespace.library from one of my applications (my.namespace.app1), it won't be able to load that resource (because it's trying to load from
https://ui5.sap.com/resources/my/namespace/library/MyResource.js which is the last resort).

I think two things would need to be changed to enable that use case:

  1. cds-ui5-plugin should serve also libraries (as far as I understood, it does not do that at the moment).
  2. cds-launchpad-plugin needs to add resourceroots to the UI5 bootstrap element in the sandbox launchpad.

But before I open an issue over at cds-ui5-plugin and try to create corresponding pull requests on both components, I first wanted to check with you (and other potential readers) if there's another solution I might have missed.

@nils
Copy link
Contributor Author

nils commented Jan 11, 2024

For the second bullet point mentioned above, one option is to

  1. copy the template files from ./node_modules/cds-launchpad-plugin/templates/legacy/{launchpad.html,appconfig.json} to ./tools/launchpad/,
  2. add the resourceroots as necessary in the launchpad.html copy and
  3. use that copied template (use relative paths to node_modules/cds-launchpad-plugin/templates, e.g. from package.json):
...
"cds": {
    ...
    "launchpad": {
      "template": "../../../tools/launchpad"
    }
}
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant