From 3bc18f6aed040fe9edf2fed206071458a967f978 Mon Sep 17 00:00:00 2001 From: Aakansha Doshi Date: Sun, 21 Feb 2021 21:08:30 +0530 Subject: [PATCH] feat: expose variable window.EXCALIDRAW_ASSET_PATH to allow host define the path for excalidraw assets (#3068) * feat: expose variable window.EXCALIDRAW_ASSET_PATH to allow host define the path for excalidraw assets No more __webpack_public_path__ needed explicitly in host and it will default to unpkg cdn if window.EXCALIDRAW_ASSET_PATH is not defined * fix * add public path * add public path * assign only when env not test * read from package.json * Append content hash to excalidraw-assets so cache bursting happens when version update * update changelog and readme * update --- public/index.html | 4 +++- src/global.d.ts | 1 + src/index.tsx | 1 - src/packages/excalidraw/CHANGELOG.md | 18 ++++++++++++++++-- src/packages/excalidraw/README.md | 8 ++------ src/packages/excalidraw/index.tsx | 1 + src/packages/excalidraw/package.json | 2 +- src/packages/excalidraw/publicPath.js | 9 +++++++++ src/packages/excalidraw/webpack.prod.config.js | 3 ++- 9 files changed, 35 insertions(+), 12 deletions(-) create mode 100644 src/packages/excalidraw/publicPath.js diff --git a/public/index.html b/public/index.html index 28b4d043e..490775f22 100644 --- a/public/index.html +++ b/public/index.html @@ -86,7 +86,9 @@ /> - + <% if (process.env.REACT_APP_GOOGLE_ANALYTICS_ID) { %>