This package is deprecated and has been moved into the hops-build package.
Hops assumes you will write an Express-style middleware, transpiles it and makes it easy to use in non-transpiled and even non-server code. Hops' renderer is a simple helper to enable you to use your custom middleware outside of Express servers.
createRenderer, creates a
render function that, if called with a
location string, returns a promise that resolves to the full body of your middleware's response.
createRenderer expects to be passed a
webpackConfig as first argument. You can also pass
watchOptions as its second.
If you want to use a custom Express middleware that's written in ECMAScript Next and transpiled reusing your Webpack loader config, to generate HTML output during your build, you might want to use this renderer. This way, you can prerender some of your pages at buildtime while using the very same code to dynamically generate other pages at runtime.
This example shows how to write and configure a custom middleware and use it to prerender pages in a build script of some sort.
..."server": "src/server.js""dependencies":"hops-build-config": "*""hops-renderer": "*"...
const createRenderer = ;const hopsBuildConfig = ;const webpackConfig = ;const render = ;;;