Do not set process to undefined #921
Description
Is your feature request related to a problem? Please describe.
Currently, webpack sets process
to undefined
new webpack.DefinePlugin({
"global.TNS_WEBPACK": "true",
"process": undefined,
}),
which breaks plugins like nativescript-nodeify
that use browser versions of library in NS.
Describe the solution you'd like
Remove "process": undefined,
or explain the reasoning behind it.
Describe alternatives you've considered
Manually disabling it, but I don't know what are the reasons it was set like that in the first place.
In my tests, commenting the line had no side effects besides making everything that was broken work.
Additional context
I'm developing a remote abstraction for @ngrx/store-devtools
. This means using browser libs that do checks on process.browser
and libs that use require('ws')
. I managed to replace require('ws')
with nativescript-websockets
, but there isn't a way to use process
without changing the default webpack behavior, and the reason for it doesn't seem to be listed anywhere besides "process
is node specific" (NativeScript/NativeScript#3080 (comment))