Skip to content

Commit

Permalink
Minor documantation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisn committed Jun 3, 2023
1 parent c52a561 commit 5c2b530
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Automatically externalize `peerDependencies` in a `rollup` bundle.
## Motivation

When bundling a library using [`rollup`](https://github.com/rollup/rollup), we generally want to keep from including [`peerDependencies`](https://nodejs.org/en/blog/npm/peer-dependencies/) since they are expected to be provided by the consumer of the library. By excluding these dependencies, we keep bundle size down and avoid bundling duplicate dependencies.
When bundling a library using [`rollup`](https://github.com/rollup/rollup), we generally want to keep from including [`peerDependencies`](https://nodejs.org/en/blog/npm/peer-dependencies/) since they are expected to be provided by the consumer of the library. By excluding these dependencies, we keep bundle size down and avoid bundling duplicate dependencies.

We can achieve this using the rollup [`external`](https://github.com/rollup/rollup/wiki/JavaScript-API#external) configuration option, providing it a list of the peer dependencies to exclude from the bundle. This plugin automates the process, automatically adding a library's `peerDependencies` to the `external` configuration.

Expand Down Expand Up @@ -64,7 +64,7 @@ export default {
plugins: [
// Preferably set as first plugin.
peerDepsExternal({
includeDependencies: true,
includeDependencies: true
})
]
};
Expand Down

0 comments on commit 5c2b530

Please sign in to comment.