If you try to use "pkg" on a project that uses "node-webcam", you will obtain a runtime issue, as described for example in the following issue on pkg repository:
The problem is caused by the __dirname in the require instructions. If we change the style of requires using relative paths, everything work as expected. For example, we should change an instruction from this:
If you try to use "pkg" on a project that uses "node-webcam", you will obtain a runtime issue, as described for example in the following issue on pkg repository:
https://github.com/zeit/pkg/issues/426
The problem is caused by the
__dirname
in therequire
instructions. If we change the style of requires using relative paths, everything work as expected. For example, we should change an instruction from this:Factory: require( __dirname + "/src/Factory.js" )
to this:
Factory: require( "./src/Factory.js" )
I can create a pull-request if you want.