webpack-server-render-middleware
v1.0.0
Published
Webpack's dev middleware for server-side rendering
Downloads
338
Maintainers
Readme
webpack-server-render-middleware
THIS MIDDLEWARE SHOULD ONLY USED FOR DEVELOPMENT!
DO NOT USE IT IN PRODUCTION!
What is this?
This project is like webpack-dev-middleware
but for server-side bundling.
Usage
import webpackSeverRenderMiddleware from 'webpack-server-render-middleware'
app.use(webpackSeverRenderMiddleware(...))
app.use((req, res) => {
const serverBundle = res.serverBundle
// than use your bundle here to render pages
})