Using path.resolve

In our JavaScript code, to make sure the code runs well whenever we run it from, we modified our `require` statements to use `path.resolve`. For example:

const QueryManager = require(path.resolve(__dirname, 'query-manager.js'));

This works fine. However, I now lost the ability to click on a name and get to the right file automatically.

Is there a known workaround for this?

 

PS. I'm actually using GoLand, but I assume for javascript questions WebStorm is better suited.

1 comment

Resolving 'constructed' paths is not currently supported, please vote for https://youtrack.jetbrains.com/issue/WEB-23612 and linked tickets to be notified on any progress with these features

Paths resolving in path.resolve() doesn't work either - https://youtrack.jetbrains.com/issue/WEB-30003

0

Please sign in to leave a comment.