Changeset View
Changeset View
Standalone View
Standalone View
keyserver/src/responders/website-responders.js
Show First 20 Lines • Show All 79 Lines • ▼ Show 20 Lines | assetInfo = { | ||||
jsURL: 'http://localhost:8080/dev.build.js', | jsURL: 'http://localhost:8080/dev.build.js', | ||||
fontsURL, | fontsURL, | ||||
cssInclude: '', | cssInclude: '', | ||||
olmFilename: '', | olmFilename: '', | ||||
}; | }; | ||||
return assetInfo; | return assetInfo; | ||||
} | } | ||||
try { | try { | ||||
const assetsString = await readFile('../web/dist/assets.json', 'utf8'); | const manifestString = await readFile('../web/dist/manifest.json', 'utf8'); | ||||
const assets = JSON.parse(assetsString); | const manifest = JSON.parse(manifestString); | ||||
assetInfo = { | assetInfo = { | ||||
jsURL: `compiled/${assets.browser.js}`, | jsURL: `compiled/${manifest['browser.js']}`, | ||||
fontsURL: googleFontsURL, | fontsURL: googleFontsURL, | ||||
cssInclude: html` | cssInclude: html` | ||||
<link | <link | ||||
rel="stylesheet" | rel="stylesheet" | ||||
type="text/css" | type="text/css" | ||||
href="compiled/${assets.browser.css}" | href="compiled/${manifest['browser.css']}" | ||||
/> | /> | ||||
`, | `, | ||||
olmFilename: assets[''].wasm, | olmFilename: manifest['olm.wasm'], | ||||
}; | }; | ||||
return assetInfo; | return assetInfo; | ||||
} catch { | } catch { | ||||
throw new Error( | throw new Error( | ||||
'Could not load assets.json for web build. ' + | 'Could not load manifest.json for web build. ' + | ||||
'Did you forget to run `yarn dev` in the web folder?', | 'Did you forget to run `yarn dev` in the web folder?', | ||||
); | ); | ||||
} | } | ||||
} | } | ||||
let webpackCompiledRootComponent: ?React.ComponentType<{}> = null; | let webpackCompiledRootComponent: ?React.ComponentType<{}> = null; | ||||
async function getWebpackCompiledRootComponentForSSR() { | async function getWebpackCompiledRootComponentForSSR() { | ||||
if (webpackCompiledRootComponent) { | if (webpackCompiledRootComponent) { | ||||
▲ Show 20 Lines • Show All 318 Lines • Show Last 20 Lines |