Skip to content

Commit d141419

Browse files
author
Stephan Septh Schreiber
committed
Dependencies update, minor doc & code tweaks
1 parent 29a504f commit d141419

File tree

5 files changed

+929
-669
lines changed

5 files changed

+929
-669
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ A Rollup plugin that automatically declares NodeJS built-in modules as `external
44

55
## Why?
66

7-
By default, Rollup doesn't know a thing about NodeJS, so using simple things like `import * as path from 'path'` in your code generates an `Unresolved dependencies` error. The solution here is twofold, depending on what you're building:
7+
By default, Rollup doesn't know a thing about NodeJS, so trying to bundle simple things like `import * as path from 'path'` in your code generates an `Unresolved dependencies` error. The solution here is twofold, depending on what you're building:
88
* If building a *standalone app*, e.g. for the browser, you'll need to use some kind of shim like those provided by [rollup-plugin-node-builtins](https://github.com/calvinmetcalf/rollup-plugin-node-builtins).
99
* If building *an npm module or lib*, you'll need to tell Rollup that the `path` module is in fact `external`: this way, Rollup won't try to bundle the module in and rather leave the `import` statement as is (or translate it to a `require()` call if bundling for CommonJS).
1010

@@ -94,9 +94,9 @@ export default {
9494

9595
### Options
9696

97-
By default, the plugin will mark all Node built-in modules and _all_ your `dev-`, `peer-` and `optionalDependencies` as external. Normal `dependencies` are left unmarked so Rollup will still bundle them within your code as expected in most situations.
97+
By default, the plugin will mark all Node built-in modules and _all_ your `dev-`, `peer-` and `optionalDependencies` as external. Normal `dependencies` are left unmarked so Rollup will still bundle them with your code as expected in most situations.
9898

99-
- Set the `deps`, `devDeps`, `peerDeps` and/or `optDeps` options to `false` to prevent the corresponding dependencies from being externalized, therefore letting Rollup bundle them within your code. Set them to `true` for Rollup to treat the corresponding dependencies as external.
99+
- Set the `deps`, `devDeps`, `peerDeps` and/or `optDeps` options to `false` to prevent the corresponding dependencies from being externalized, therefore letting Rollup bundle them with your code. Set them to `true` for Rollup to treat the corresponding dependencies as external.
100100

101101
- Use the `exclude` option to remove certain dependencies from the list of externals. `exclude` can be a string, a regex, or an array of those, for example:
102102
```js
@@ -128,7 +128,7 @@ and you don't want `mylib` bundled in, then write:
128128
```js
129129
// in rollup.config.js:
130130
externals({
131-
include: '@/mylib' // or include: /^@\//
131+
include: '@/mylib' // /^@\// or /mylib$/ would work too
132132
})
133133
```
134134

0 commit comments

Comments
 (0)