Changeset View
Changeset View
Standalone View
Standalone View
keyserver/src/responders/landing-handler.js
Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | if (process.env.NODE_ENV === 'development') { | ||||
assetInfo = { | assetInfo = { | ||||
jsURL: 'http://localhost:8082/dev.build.js', | jsURL: 'http://localhost:8082/dev.build.js', | ||||
fontURLs, | fontURLs, | ||||
cssInclude: '', | cssInclude: '', | ||||
}; | }; | ||||
return assetInfo; | return assetInfo; | ||||
} | } | ||||
try { | try { | ||||
const assetsString = await readFile('../landing/dist/assets.json', 'utf8'); | const manifestString = await readFile( | ||||
const assets = JSON.parse(assetsString); | '../landing/dist/manifest.json', | ||||
'utf8', | |||||
); | |||||
const manifest = JSON.parse(manifestString); | |||||
assetInfo = { | assetInfo = { | ||||
jsURL: `compiled/${assets.browser.js}`, | jsURL: `compiled/${manifest['browser.js']}`, | ||||
fontURLs: [googleFontsURL, iaDuoFontsURL], | fontURLs: [googleFontsURL, iaDuoFontsURL], | ||||
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']}" | ||||
/> | /> | ||||
`, | `, | ||||
}; | }; | ||||
return assetInfo; | return assetInfo; | ||||
} catch { | } catch { | ||||
throw new Error( | throw new Error( | ||||
'Could not load assets.json for landing build. ' + | 'Could not load manifest.json for landing build. ' + | ||||
'Did you forget to run `yarn dev` in the landing folder?', | 'Did you forget to run `yarn dev` in the landing folder?', | ||||
); | ); | ||||
} | } | ||||
} | } | ||||
type LandingApp = React.ComponentType<LandingSSRProps>; | type LandingApp = React.ComponentType<LandingSSRProps>; | ||||
let webpackCompiledRootComponent: ?LandingApp = null; | let webpackCompiledRootComponent: ?LandingApp = null; | ||||
async function getWebpackCompiledRootComponentForSSR() { | async function getWebpackCompiledRootComponentForSSR() { | ||||
▲ Show 20 Lines • Show All 127 Lines • Show Last 20 Lines |