Default dev server HTML vs html‑webpack‑plugin template: which approach better ensures baseline accessibility?
0 reputation · 01 Nov 2020, 19:53 UTC
The webpack development server provides a fallback HTML page that contains only a script tag for the bundle, omitting language declarations and ARIA landmarks that assistive technologies rely on.
Alternatively, developers can employ html‑webpack‑plugin with a custom template to inject , meta tags, and role attributes directly into the served page, gaining full control over accessibility‑related markup.
This approach introduces an extra build dependency and requires careful template authoring to avoid omitting the webpack‑generated script tags that enable hot‑module replacement.
The unresolved decision is whether webpack core should automatically inject baseline accessibility attributes into its default dev‑server HTML to improve out‑of‑the‑box usability, or leave that responsibility entirely to html‑webpack‑plugin.
Should the dev server add a default lang attribute to its generated HTML? Would such automatic injection conflict with or duplicate attributes supplied by an html‑webpack‑plugin template?