Please give a brief summary of your issue:
First of all I want to understand if it is still needed to upload the folder for each site when you are deploying the web part/ extension and so on or I can leave it inside the web part project, just bundle it and it will work.
I mean this steps:
3. In the Document Library of your SharePoint site, create a “Webviewer” folder and create another child folder “js” inside the “Webviewer” folder.
4. Upload the lib folder extracted from the WebViewer.zip to the js folder.
The webviewer lib folder should now be available from the url: https://.sharepoint.com/sites//Shared Documents/Webviewer/js/lib.
Second question is if I want to deploy web part for example how can I make it easily usable on different tenants and sites without using .env file ? Cause I’m not completely understand how to make it.
Bundling the project with the lib folder inside should be sufficient.
If you are bundling it in an app and not including the lib folder the files, then https://.sharepoint.com/sites//Shared Documents/Webviewer/js/lib
aka the domain that is hosting WebViewer wont have the files.
Best Regards,
Jacob Romano Carlsen
Web Development Support Engineer Apryse Software Inc.
Also wanted to clarify what is a correct way, to provide config.js file ? Cause for now I receive problem that viewer is on a different domain when make it through azure cdn, and it gives me suggestion to create config.js and put code in there. I tried to put it as a separate blob in my azure storage, but after I provide config field to Webviewer class, after “then” “instance” is undefined
Since you have the path option specified on another domain, you will need to edit the lib/ui/configorigin.txt file to whitelist your app’s domain(s).
See this link for more info: Apryse Documentation | Documentation
It is also worth noting that we encourage config files to first be added within the project files and passed in as a relative URL, relative to the HTML file.