react serverside rendering for webpack.
npm i react-render-webpack-plugin --save
webpack.prod.config.js
:
const reactRenderPlugin = require('react-render-webpack-plugin');
module.exports = {
plugins: [
new reactRenderPlugin({
'file': 'src/app.jsx', // The entry file of your app
'parentClass': 'app-react' // the class-selector to render into
})
]
}
index.html
:
<!DOCTYPE html>
<html lang="en">
<body>
<div class="app-react"></div>
<script src="app.min.js"></script>
</body>
</html>