tom-pytel commented on a change in pull request #29:
URL: https://github.com/apache/skywalking-nodejs/pull/29#discussion_r581014491
##########
File path: src/core/PluginInstaller.ts
##########
@@ -33,7 +34,7 @@ while (topModule.parent) {
export default class PluginInstaller {
private readonly pluginDir: string;
readonly require: (name: string) => any = topModule.require.bind(topModule);
- private readonly resolve = (request: string) => (module.constructor as
any)._resolveFilename(request, topModule);
+ private readonly resolve = (request: string) => resolve.sync(request);
Review comment:
Question about this, the current form `(module.constructor as
any)._resolveFilename(request, topModule);` ensures that the resolution is done
from the point of view of the topmost module (the main app). This is necessary
because if for example you have skwalking `npm link`ed into a project instead
of installed alongside all its dependancies then normal resolve will get the
wrong path, one that sits in the skywalking node_modules path instead of the
applicatiuon. Does the `resolve` package do this?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]