excalidraw icon indicating copy to clipboard operation
excalidraw copied to clipboard

Allow setting EXCALIDRAW_ASSET_PATH as env variable

Open krzysztofMlczk opened this issue 2 years ago • 2 comments

Background

According to this part of the documentation. In order to force excalidraw to use static assets hosted by me my code needs to set global variable window.EXCALIDRAW_ASSET_PATH. However in case of e.g. chrome extensions due to security reasons it is not possible to set such variable on the parent window level, from which those assets are requested (in my usecase excalidraw is injected into webpage).

Please keep in mind that in manifest V3 there is no way to allow external content to be loaded into webpages (again due to security reasons it is not possible to relax CSPs).

Solution proposal

Allow to set EXCALIDRAW_ASSET_PATH as environment variable similar to how it is done in case of process.env.IS_PREACT.

Related discord thread

krzysztofMlczk avatar Feb 09 '24 08:02 krzysztofMlczk

Same need here. I would need to set EXCALIDRAW_ASSET_PATH as environment var because my SVG are exported during build (kroki)

jonesbusy avatar Apr 23 '24 17:04 jonesbusy

Well, was able to fix it by https://docs.kroki.io/kroki/setup/configuration/#_excalidraw_static_assets

jonesbusy avatar Apr 24 '24 07:04 jonesbusy