Skip to content

fengzilong/html-append-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

🔨 webpack plugin, append content to html files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published