File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ // Based on https://github.com/defunctzombie/node-process
2+ // Copyright (c) 2013 Roman Shtylman <shtylman@gmail.com>
3+
4+ // Changes:
5+ // - use setImmediate for process.nextTick
6+
7+ var process = module . exports = { } ;
8+
9+ process . nextTick = setImmediate ;
10+
11+ process . title = 'browser' ;
12+ process . browser = true ;
13+ process . env = { } ;
14+ process . argv = [ ] ;
15+ process . version = '' ; // empty string to avoid regexp issues
16+ process . versions = { } ;
17+
18+ function noop ( ) { }
19+
20+ process . on = noop ;
21+ process . addListener = noop ;
22+ process . once = noop ;
23+ process . off = noop ;
24+ process . removeListener = noop ;
25+ process . removeAllListeners = noop ;
26+ process . emit = noop ;
27+ process . prependListener = noop ;
28+ process . prependOnceListener = noop ;
29+
30+ process . listeners = function ( name ) { return [ ] }
31+
32+ process . binding = function ( name ) {
33+ throw new Error ( 'process.binding is not supported' ) ;
34+ } ;
35+
36+ process . cwd = function ( ) { return '/' } ;
37+ process . chdir = function ( dir ) {
38+ throw new Error ( 'process.chdir is not supported' ) ;
39+ } ;
40+ process . umask = function ( ) { return 0 ; } ;
Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ module.exports = ({ outputDir }) => ({
2727 new CleanWebpackPlugin ( [ outputDir ] ) ,
2828 // Use latest readable-stream version (as opposed to stream-browserify)
2929 new NormalModuleReplacementPlugin ( / ^ s t r e a m $ / , require . resolve ( 'readable-stream/readable-browser' ) ) ,
30+ // Shim process to use faster process.nextTick implementation
31+ new NormalModuleReplacementPlugin ( / p r o c e s s \/ b r o w s e r \. j s $ / , require . resolve ( '../browser/process' ) ) ,
3032 ] ,
3133 externals : {
3234 'solid-auth-client' : [ 'solid' , 'auth' ] ,
You can’t perform that action at this time.
0 commit comments