Skip to content

docs(guides): fix lodash classification from peerDependency to depend…#8094

Open
jay7-tech wants to merge 1 commit intowebpack:mainfrom
jay7-tech:fix/author-libraries-lodash-dep
Open

docs(guides): fix lodash classification from peerDependency to depend…#8094
jay7-tech wants to merge 1 commit intowebpack:mainfrom
jay7-tech:fix/author-libraries-lodash-dep

Conversation

@jay7-tech
Copy link

Fixes #6896.

(Incorrect advice to use peerDependencies for utility libraries).

The Authoring Libraries guide was advising developers to treat utility libraries like lodash as peerDependencies to avoid bundle bloat when externalizing them. However, a in the issue, if a library relies on lodash internally at runtime, it must be listed in dependencies.

peerDependencies are strictly for packages that a consumer must install directly in their own app to satisfy the library's environment (eg React for a UI component library). dependencies guarantees the package manager installs the utility library automatically.

This PR simply correctly updates the text to advise using dependencies instead, while keeping the explanation of how to externalize it in the webpack config to prevent duplication.

What kind of change does this PR introduce?

Fix / Documentation

Did you add tests for your changes?

NA

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?

N/A

Use of AI

None.

@vercel
Copy link

vercel bot commented Mar 22, 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 22, 2026 5:49am

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.

Misguiding document on authoring libraries

1 participant