npm install react-to-static-html-webpack-plugin
This project was created to generate a html (templates) file from your react webpack entry
You can try this package cloning the repository and accessing the folder example/
// webpack.config.js
const ReactToHtmlWebpackPlugin = require("react-to-html-webpack-plugin");
module.exports = {
// ...your webpack config
plugins: [
new ReactToHtmlWebpackPlugin({
globals = // {custom-global-object}
htmlHeader = // "custom => <!DOCTYPE html>";
chunks = // custom allowed chunks => ['<my-chunk>'];
excludedChunks = // custom excluded chunks => ['<my-chunk>'];
postRender = // custom post render method => [(content) => content]
keepJsFile = // keep generated js file (not just the parsed html file)
cache = // create cache for the running build at node_modules/.cache folder (default: true)
});
]
// ...your webpack config
}
No build needed
My commits convention is based at AngularJs Commits Convention