How to avoid relative paths in Javascript import autocompletion?

Hi guys,

how can we change the javascript import autocompletion on IntelliJ to use the "sources root" folder instead of relative paths?

This is related to the NODE_PATH=src.


For example,

How can we achieve this:

import {MyClass} from 'components/administration/dashboard'

instead of this:

import {MyClass} from "../../dashboard";



Please try marking `src` as Resource root (Mark directory as/Resource Root) and enabling Use paths relative to project, resource or sources roots in Settings | Editor | Code Style | JavaScript | Imports - does it help?


Hi, I'd prefer import from relative path when file to import is in the same folder, but auto import always use absolute path base on tsconfig, which will resolve a longer path than relative path. I'm using webstorm 2018.1.3


Please vote for to be notified on any progress with it


Please sign in to leave a comment.