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 * updatepull/3077/head
parent
7c5481b877
commit
3bc18f6aed
@ -0,0 +1,9 @@
|
||||
import { ENV } from "../../constants";
|
||||
import pkg from "./package.json";
|
||||
if (process.env.NODE_ENV !== ENV.TEST) {
|
||||
/* eslint-disable */
|
||||
/* global __webpack_public_path__:writable */
|
||||
__webpack_public_path__ =
|
||||
window.EXCALIDRAW_ASSET_PATH ||
|
||||
`https://unpkg.com/${pkg.name}@${pkg.version}/dist/`;
|
||||
}
|
Loading…
Reference in New Issue