1.0.2 • Published 8 years ago

html-append-loader v1.0.2

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

html-append-loader

Install

$ npm install --save html-append-loader

Usage

The loader will append content to html files within loader

var script = escape('<srcipt>console.log("test")</srcipt>');
var webpackConfig = {
  entry: 'index.js',
  output: {
    path: 'dist',
    filename: 'bundle.js'
  },
  module: {
      loaders: [
        {
          test: /\.html$/,
          loader: 'html-append?position=head&content='+script
        },
      ]
  }
}

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

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

License

MIT ©

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago