html-append-plugin

0.0.4 • Public • Published

html-append-plugin

Install

$ npm install html-append-plugin -D

Usage

The plugin will append content to html files duration compilation

var HtmlWebpackPlugin = require('html-webpack-plugin');
var htmlAppendPlugin = require('html-append-plugin');
var webpackConfig = {
  entry: 'index.js',
  output: {
    path: 'dist',
    filename: 'bundle.js'
  },
  plugins: [
    new HtmlWebpackPlugin(),
    new htmlAppendPlugin({
      append: 'added content'
      // or
      // append: function(){
      //   return 'added content';
      // }
    })
  ]
}

This will generate a file dist/index.html containing the following content:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Webpack App</title>
  </head>
  <body>
    <script src="bundle.js"></script> 
    added content
  </body>
</html>

License

MIT © fengzilong

Readme

Keywords

none

Package Sidebar

Install

npm i html-append-plugin

Weekly Downloads

2

Version

0.0.4

License

MIT

Last publish

Collaborators

  • fengzilong