Need private packages and team management tools?Check out npm Teams »

react-to-static-html-webpack-plugin

1.2.1 • Public • Published

React To Static Html Webpack Plugin

npm install react-to-static-html-webpack-plugin

Introduction

This project was created to generate a html (templates) file from your react webpack entry

Example

You can try this package cloning the repository and accessing the folder example/

Getting Started

⚠️ every config is optional

// 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
}

Build and Test

No build needed

Contribute

Commit Guidelines

My commits convention is based at AngularJs Commits Convention

Install

npm i react-to-static-html-webpack-plugin

DownloadsWeekly Downloads

3

Version

1.2.1

License

MIT

Unpacked Size

10.7 kB

Total Files

6

Last publish

Collaborators

  • avatar