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

Commit 0596cab

Browse files
keithamuslukastaegert
authored andcommitted
docs: add note on builtins (#215)
Fixes #146
1 parent 6eb687b commit 0596cab

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

+17
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,23 @@ export default {
112112
};
113113
```
114114

115+
## Resolving Built-Ins (like `fs`)
116+
117+
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.
118+
119+
If you want to silence warnings about builtins, you can add the list of builtins to the `externals` option; like so:
120+
121+
```js
122+
import resolve from 'rollup-plugin-node-resolve';
123+
import builtins from 'builtin-modules'
124+
export default ({
125+
input: ...,
126+
plugins: [resolve()],
127+
externals: builtins,
128+
output: ...
129+
})
130+
```
131+
115132

116133
## License
117134

0 commit comments

Comments
 (0)