Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

Commit

Permalink
docs: add note on builtins (#215)
Browse files Browse the repository at this point in the history
Fixes #146
  • Loading branch information
keithamus authored and lukastaegert committed May 10, 2019
1 parent 6eb687b commit 0596cab
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Expand Up @@ -112,6 +112,23 @@ export default {
};
```

## Resolving Built-Ins (like `fs`)

This plugin won't resolve any builtins (e.g. `fs`). If you need to resolve builtins you can install local modules and set `preferBuiltins` to `false`, or install a plugin like [rollup-plugin-node-builtins](https://github.com/calvinmetcalf/rollup-plugin-node-builtins) which provides stubbed versions of these methods.

If you want to silence warnings about builtins, you can add the list of builtins to the `externals` option; like so:

```js
import resolve from 'rollup-plugin-node-resolve';
import builtins from 'builtin-modules'
export default ({
input: ...,
plugins: [resolve()],
externals: builtins,
output: ...
})
```


## License

Expand Down

0 comments on commit 0596cab

Please sign in to comment.