diff --git a/README.md b/README.md index 1e953dd..9bbbeb4 100644 --- a/README.md +++ b/README.md @@ -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