tern icon indicating copy to clipboard operation
tern copied to clipboard

Way to define base path for absolute import paths?

Open bhurlow opened this issue 7 years ago • 4 comments

I'm using babel module resolver in my js project. All imports are absolute, for example:

import { serveNotFound, serveRedirect } from 'src/lib/response'

How can I configure tern to look up paths starting from a base path above src?

bhurlow avatar Aug 23 '18 16:08 bhurlow

As far as I know there is no such way now. But I think it might be necessary to add this feature. Could you help provide a simple project use this approach I can play with and develop on it?

othree avatar Aug 28 '18 01:08 othree

https://ternjs.net/doc/manual.html#plugin_webpack not doing this?

albert200000 avatar Aug 18 '22 16:08 albert200000

@albert200000 The webpack plugin loads the webpack config and enhanced resolver to resolve files. Not the babel module resolver.

othree avatar Aug 19 '22 00:08 othree

https://gist.github.com/jeremija/046f9df54000f4059af3ec987d2dfb5f can be used as workaround?

albert200000 avatar Aug 19 '22 06:08 albert200000