Primus202
Primus202

Reputation: 646

Can't get meta option to output anything for HTML Webpack Plugin

Docs make it sound like I can output my header meta with the following:

plugins: [
  new HtmlWebPackPlugin({
    title: 'Benjamin Chirlin - Web Devloper',
    filename: "./index.html",
    meta: {
      description: "A description",
      author: "My Name" ,
      viewport: "width=device-width,height=device-height,initial-scale=1.0,maximum-scale=1"
    }
  })
]

Removing my template option helped make the title option work but no matter what I try meta seems broken still. I found more detailed examples in the spec but even following those it doesn't work...help please? Guessing I have something wrong in my config somewhere.

Upvotes: 0

Views: 616

Answers (1)

Primus202
Primus202

Reputation: 646

Meta doesn't currently have an output in the default webpack template. I ended up using the extended HTML Webpack Template plugin which requires a slightly different format but does work out of the box. It's silly webpack would provide options that have no default output. You can theoretically write your own template that would loop through all the options etc but that's a major pain (considering it's a built in option).

Upvotes: 1

Related Questions