You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This means the JSON files are being embedded into the javascript in the bundle. It would be nice if these could be standalone so that in theory someone could inspect the dist and see the registry json files separately.
But then we need some way for our code to retrieve this. Two methods I explored both required converting to an async api. Not the end of the world though.
// Fetch the local fileexportconstgetRegistry=async(name: string): Promise<JsonRegistry>=>{constfileUrl=newURL(`./registry/${name}.json`,import.meta.url).href;constresponse=awaitfetch(fileUrl);if(!response.ok){thrownewError('Network response was not ok');}returnresponse.json();};
Unfortunately, this did not work in node environments (assuming fs is more standard here). Later tried:
Follow up from: #29 (comment) from @turbocrime
As of #29, we are bundling the registry along with the package. Our current bundle looks like this:
This means the JSON files are being embedded into the javascript in the bundle. It would be nice if these could be standalone so that in theory someone could inspect the dist and see the registry json files separately.
This is a bit tricky though. First we have to copy over the registry files in our vite config:
But then we need some way for our code to retrieve this. Two methods I explored both required converting to an
async
api. Not the end of the world though.Unfortunately, this did not work in node environments (assuming
fs
is more standard here). Later tried:This seems to work in node+browser environments, but throws a
document not found
error in our service worker 😢 . Ended the exploration here.The text was updated successfully, but these errors were encountered: