Skip to content

Commit f796e4d

Browse files
committed
chore(): update readme
1 parent e8565e2 commit f796e4d

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

readme.md

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
rollup-plugin-node-builtins
1+
rollup-plugin-node-polyfills
22
===
33

44
```
5-
npm install --save-dev rollup-plugin-node-builtins
5+
npm install --save-dev rollup-plugin-node-polyfills
66
```
77

8-
Allows the node builtins to be `require`d/`import`ed. Doing so gives the proper shims to support modules that were designed for Browserify, some modules require [rollup-plugin-node-globals](https://github.com/calvinmetcalf/rollup-plugin-node-globals).
8+
Allows the node builtins to be `require`d/`import`ed.
99

1010
The following modules include ES6 specific version which allow you to do named imports in addition to the default import and should work fine if you only use this plugin.
1111

@@ -42,7 +42,6 @@ The following modules include ES6 specific version which allow you to do named i
4242
- fs˚
4343
- crypto˚
4444

45-
\* requires [node-globals plugin](https://github.com/calvinmetcalf/rollup-plugin-node-globals)
4645

4746
† the http and https modules are actually the same and don't differentiate based on protocol
4847

@@ -56,18 +55,16 @@ The following modules include ES6 specific version which allow you to do named i
5655

5756
Crypto is not shimmed and and we just provide the commonjs one from browserify and it will likely not work, if you really want it please pass `{crypto: true}` as an option.
5857

59-
60-
6158
Not all included modules rollup equally, streams (and by extension anything that requires it like http) are a mess of circular references that are pretty much impossible to tree-shake out, similarly url methods are actually a shortcut to a url object so those methods don't tree shake out very well, punycode, path, querystring, events, util, and process tree shake very well especially if you do named imports.
6259

6360
config for using this with something simple like events or querystring
6461

6562
```js
66-
import builtins from 'rollup-plugin-node-builtins';
63+
import nodePolyfills from 'rollup-plugin-node-polyfills';
6764
rollup({
6865
entry: 'main.js',
6966
plugins: [
70-
builtins()
67+
nodePolyfills()
7168
]
7269
})
7370
```
@@ -84,13 +81,11 @@ import {inherits} from 'util';
8481
Config for something more complicated like http
8582

8683
```js
87-
import builtins from 'rollup-plugin-node-builtins';
88-
import globals from 'rollup-plugin-node-globals';
84+
import nodePolyfills from 'rollup-plugin-node-polyfills';
8985
rollup({
9086
entry: 'main.js',
9187
plugins: [
92-
globals(),
93-
builtins()
88+
nodePolyfills()
9489
]
9590
})
9691
```

0 commit comments

Comments
 (0)