Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

Commit

Permalink
Support loading full bundles from file paths (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
itowlson authored Dec 10, 2018
1 parent e1240ef commit 9c07898
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/utils/embedded.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,13 @@ async function loadFullBundle(): Promise<{} | undefined> {
if (!bundleUrl) {
return undefined;
}
const bundleContent = await request.get(bundleUrl, { encoding: null });
return bundleContent;
if (bundleUrl.startsWith('http')) {
const bundleContent = await request.get(bundleUrl, { encoding: null });
return bundleContent;
} else {
const bundleContent = await fs.readFile(bundleUrl);
return bundleContent;
}
}

export async function hasFullBundle(): Promise<boolean> {
Expand Down

0 comments on commit 9c07898

Please sign in to comment.