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:
19
modules/utils/getEntryPoints.js
Normal file
19
modules/utils/getEntryPoints.js
Normal 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;
|
||||
}, {});
|
||||
}
|
||||
Reference in New Issue
Block a user