flowbased / fbp-protocol-client

JavaScript client library for FBP protocol connection handling
8 stars 5 forks source link

Fix webpack #82

Closed jonnor closed 7 years ago

jonnor commented 7 years ago

No idea why this is still broken in this way.

jonnor commented 7 years ago

Ok the problem is that with Webpack, the Emscripten-generated code believes it is running in Node.js when in the browser... So it attempts to access things which dont make sense like process.argv.

jonnor commented 7 years ago

Passes locally if I add !ENVIRONMENT_IS_WEB inside microflo-runtime.js. Will see if I can automate.

var ENVIRONMENT_IS_WEB = typeof window === 'object';
var ENVIRONMENT_IS_NODE = !ENVIRONMENT_IS_WEB && typeof process === 'object' && typeof require === 'function';