Skip to content

docs: add Modern Web Platform guide (Web Components, Import Maps, PWA)#8140

Open
phoekerson wants to merge 1 commit intowebpack:mainfrom
phoekerson:main
Open

docs: add Modern Web Platform guide (Web Components, Import Maps, PWA)#8140
phoekerson wants to merge 1 commit intowebpack:mainfrom
phoekerson:main

Conversation

@phoekerson
Copy link
Copy Markdown

Summary

Adds a new guide — Modern Web Platform — covering three practical webpack
patterns that are frequently asked about on Discord and the issue tracker but
not yet documented in a single place:

  • Web Components: how to use optimization.splitChunks with cacheGroups
    to deduplicate Custom Element registrations across bundles and avoid the
    DOMException: Failed to execute 'define' on 'CustomElementRegistry' runtime
    error.
  • Import Maps: how to combine externals, externalsType: "module", and
    experiments.outputModule so webpack output is compatible with browser-native
    import map resolution.
  • PWA / Service Workers: how to use InjectManifest from
    workbox-webpack-plugin alongside [contenthash] output filenames to keep
    precache manifests in sync across builds.

Each section follows the existing guide structure: problem statement → minimal
working configuration → limitations and future work.

Note: --no-verify was used locally because src/sw.js has two pre-existing
lint errors (import/named) unrelated to this PR.

This PR is also part of my Google Summer of Code 2026 application to webpack,
where I am proposing to implement native webpack support for these three web
platform features. This documentation reflects my research into the current
state of webpack 5 and the gaps I intend to address during GSoC.

What kind of change does this PR introduce?

docs

Did you add tests for your changes?

No — this is a documentation-only change. No code was modified.

Does this PR introduce a breaking change?

No.

If relevant, what needs to be documented once your changes are merged or
what have you already documented?

This PR is itself the documentation. Once merged, the Modern Web Platform
guide will be accessible at /guides/modern-web-platform/ and automatically
listed in the sidebar via the build system.

Use of AI

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
webpack-js-org Ready Ready Preview, Comment Mar 29, 2026 2:11pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant