Server render the main page

Also, add hashes to asset file names and use the "entry manifest" plugin
in dev to get auto-reloading.
This commit is contained in:
Michael Jackson
2019-01-12 19:27:28 -08:00
parent 45c48cba26
commit 09914c1db4
176 changed files with 2725 additions and 119822 deletions

View File

@ -0,0 +1,19 @@
import invariant from 'invariant';
// Virtual module id; see rollup.config.js
import entryManifest from 'entry-manifest';
export default function getEntryPoints(entryName, formatKeys) {
const manifest = entryManifest[entryName];
invariant(manifest, 'Invalid entry name: %s', entryName);
return manifest.reduce((memo, entryPoint) => {
if (entryPoint.format in formatKeys) {
const key = formatKeys[entryPoint.format];
memo[key] = entryPoint.url;
}
return memo;
}, {});
}