Node plugin: dynamic resolution of the module name

32 views
Skip to first unread message

Paulo Vieira

unread,
Feb 17, 2015, 6:52:35 AM2/17/15
to tern...@googlegroups.com
Hello all!

In my node code, I require my private modules as such

```
 var utils = require(global.rootPath + "server/common/utils");
```

This way Tern fails to lookup the module correctly. But it's fine If I use a relative directory, such as

```
 var utils = require("../../server/common/utils");
```

Is there anyway to make Tern find the module using the first way? Or would you recommend some workaround (such as setting some environment variable)?

Thanks for any help!

Marijn Haverbeke

unread,
Feb 17, 2015, 6:58:20 AM2/17/15
to Paulo Vieira, tern-dev
Tern currently has no way to figure out the value of non-static
strings, and thus will not resolve dependencies required in this way.
There is no workaround.
> --
> You received this message because you are subscribed to the Google Groups
> "tern-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to tern-dev+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages