Skip to content

Commit def6ae3

Browse files
committed
fix: use workaround loading process-shim for browserify
1 parent 6efcd35 commit def6ae3

10 files changed

+9
-32
lines changed

README.md

+1-21
Original file line numberDiff line numberDiff line change
@@ -87,27 +87,7 @@ shown in the example above.
8787

8888
## Usage In Browsers
8989

90-
You will need a bundler like [`browserify`](https://github.com/browserify/browserify#readme), [`webpack`](https://webpack.js.org/), [`parcel`](https://github.com/parcel-bundler/parcel#readme) or similar. With Webpack 5 (which unlike other bundlers does not polyfill Node.js core modules and globals like `process`) you will also need to:
91-
92-
1. Install polyfills by running `npm install buffer process --save-dev`
93-
2. Create a [`webpack.config.js`](https://webpack.js.org/guides/getting-started/#using-a-configuration) file containing:
94-
95-
```js
96-
const webpack = require('webpack')
97-
98-
module.exports = {
99-
plugins: [
100-
new webpack.ProvidePlugin({
101-
process: 'process/browser'
102-
})
103-
],
104-
resolve: {
105-
fallback: {
106-
buffer: require.resolve('buffer/')
107-
}
108-
}
109-
}
110-
```
90+
You will need a bundler like [`browserify`](https://github.com/browserify/browserify#readme), [`webpack`](https://webpack.js.org/), [`parcel`](https://github.com/parcel-bundler/parcel#readme) or similar. Polyfills are no longer required since version 4.2.0.
11191

11292
# Streams Working Group
11393

build/headers.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const bufferRequire = `
99
const processRequire = `
1010
/* replacement start */
1111
12-
const process = require('process')
12+
const process = require('process/')
1313
1414
/* replacement end */
1515
`

lib/internal/streams/destroy.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/* replacement start */
44

5-
const process = require('process')
5+
const process = require('process/')
66

77
/* replacement end */
88

lib/internal/streams/duplexify.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* replacement start */
22

3-
const process = require('process')
3+
const process = require('process/')
44

55
/* replacement end */
66

lib/internal/streams/end-of-stream.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* replacement start */
22

3-
const process = require('process')
3+
const process = require('process/')
44

55
/* replacement end */
66
// Ported from https://github.com/mafintosh/end-of-stream with

lib/internal/streams/from.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/* replacement start */
44

5-
const process = require('process')
5+
const process = require('process/')
66

77
/* replacement end */
88

lib/internal/streams/pipeline.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* replacement start */
22

3-
const process = require('process')
3+
const process = require('process/')
44

55
/* replacement end */
66
// Ported from https://github.com/mafintosh/pump with

lib/internal/streams/readable.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* replacement start */
22

3-
const process = require('process')
3+
const process = require('process/')
44

55
/* replacement end */
66
// Copyright Joyent, Inc. and other Node contributors.

lib/internal/streams/writable.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* replacement start */
22

3-
const process = require('process')
3+
const process = require('process/')
44

55
/* replacement end */
66
// Copyright Joyent, Inc. and other Node contributors.

process

-3
This file was deleted.

0 commit comments

Comments
 (0)