This should address what was mentioned in PR #12 without any BREAKING CHANGES :crossed_fingers:.
The goal of this PR is to achieve the following:
Allow us to call require() inside of the code we are calling without having to deal with any awkward module resolution by re-exporting/etc. This should minimize the amount of restrictions/limitations we have when dealing with requiring modules that are located inside of the typical node_modules directory.
Removes some unused code in the priv/server.js file which had an early return in the rewriteRequire function. I think we can re-introduce this again once we figure out the MODULE_SEARCH_PATH logic, which has to do with how you are calling require().
This is done by simply expanding the NODE_PATH we already set by including the /node_modules directory for the path specified. It's a valid workaround and does address some of the limitations around the node_modules directory.
My understanding is that path is considered our "working directory" in which everything would be ran from. It would make sense for us to also include the /node_modules as part of the NODE_PATH lookup if this is true.
This should address what was mentioned in PR #12 without any
BREAKING CHANGES
:crossed_fingers:.The goal of this PR is to achieve the following:
require()
inside of the code we are calling without having to deal with any awkwardmodule resolution
by re-exporting/etc. This should minimize the amount of restrictions/limitations we have when dealing with requiring modules that are located inside of the typicalnode_modules
directory.priv/server.js
file which had an early return in therewriteRequire
function. I think we can re-introduce this again once we figure out theMODULE_SEARCH_PATH
logic, which has to do with how you are callingrequire()
.This is done by simply expanding the
NODE_PATH
we already set by including the/node_modules
directory for the path specified. It's a valid workaround and does address some of the limitations around thenode_modules
directory.My understanding is that
path
is considered our "working directory" in which everything would be ran from. It would make sense for us to also include the/node_modules
as part of theNODE_PATH
lookup if this is true.