title: How do I add certain script tags inside <head> and <body> tags when using HtmlWebackPlugin
body: <p>I'm using HtmlWebpackPlugin to generate HTML files with javascript.</p>
  
  <p>Now I would like to add custom script at different parts of <code>&lt;head&gt;</code> and <code>&lt;body&gt;</code> tags</p>
  
  <p>Example:</p>
  
  <p>How do I,</p>
  
  <ol>
  <li>Add <code>&lt;script&gt; alert('in head tag') &lt;/script&gt;</code> inside
  the <code>&lt;head&gt;</code> tag as the first child</li>
  <li>Add <code>&lt;script&gt; alert('in body tag') &lt;/script&gt;</code> inside
  the <code>&lt;body&gt;</code> tag as the first child</li>
  </ol>
  
  <p>Here is the snippet in my Webpack config</p>
  
  <pre><code>        new HtmlWebpackPlugin({
          hash: true,
          chunks: ["app"],
          filename: path.resolve(__dirname, "./public/pages/app.html"),
          title: "Title of webpage",
          template: path.resolve(__dirname, "./src/pages/app.page.html"),
          minify: {
              collapseWhitespace: true
          }
      })
  </code></pre>