Yesterday I blindly copied the Webpack "Getting Started" index.html page to build a quick prototype. The next 50 minutes I'm debugging weird layout bugs. It seems the example snippet does not contain a DOCTYPE and I forgot to add it myself.
Maybe have it there by default?
webpack website shows in its examples the minimal requirements to wort with it, specify details about other technologies are no essential.
@montogeek I understand that examples need to be kept as concise as possible. It worries me that a DOCTYPE is considered a "specific detail". ~Following that reasoning, the <title> tag could also be removed.~ _edit: It can't be removed as it's a requirement for a valid HTML page._
If other devs are building their products/prototypes based on these examples they could find themselves in unnecessary trouble.
title is part of the guide. HTML knowledge is out of the scope of webpack documentation
I'm with @rikschennink here. If you're providing an entire HTML file, I would expect those to be complete.
+1
We are not providing an entire HTML file, just the minimal HTML to show how webpack works
@montogeek A minimal HTML file (that is still valid) really should have a <!doctype html> at the top.
I'm reading here that it should also have a <title> tag, my earlier statement about removing it seems to be incorrect.
Can you please submit a PR to add it in all necessary examples? Not those generated by plugins.
@montogeek happy to do that somewhere this week or the next.
@rikschennink this is a really good point. I'm probably responsible for this mishap, so I've taken the liberty to include it for our v4 Guides (https://github.com/webpack/webpack.js.org/pull/1862) and I will open a quick PR (https://github.com/webpack/webpack.js.org/pull/1868) for the current docs as well.
You're totally right: the examples should be working and correct, even if they're minimal examples.
Thanks for the good catch!
@TheDutchCoder Fantastic! Thanks for taking the time to fix it Reinier. I'll remove it from my todo list 馃檪
It would b good to check the rest of the site and try to spot places where this was also happening and fix it.
This was solved by https://github.com/webpack/webpack.js.org/pull/1868
Thanks everyone!
Most helpful comment
@rikschennink this is a really good point. I'm probably responsible for this mishap, so I've taken the liberty to include it for our v4 Guides (https://github.com/webpack/webpack.js.org/pull/1862) and I will open a quick PR (https://github.com/webpack/webpack.js.org/pull/1868) for the current docs as well.
You're totally right: the examples should be working and correct, even if they're minimal examples.
Thanks for the good catch!