BaseURL Support in Webstorm

I'm trying to convince my team to move to Webstorm from VSCode. 

I'm having issue getting cmd+click to work on code like this: 

import MapPin from 'components/shared/pins/presentational/MapPin';
import BlockHeading from 'components/shared/generic/blockHeading/presentational/BlockHeading';

We solved this in VSCode by including a jsconfig.json in the root. 

{
"compilerOptions": {
"module": "CommonJS",
"baseUrl": "src/"
}
}

How can we do this in Webstorm? 

2 comments

You can try marking `src` folder as Resource root (Mark directory as/Resource root) and enabling Use paths relative to the project, resource or sources roots in Settings | Editor | Code Style | JavaScript | Imports

 

We plan to provide support for path mappings defined in jsconfig.json in 2019.2, see https://youtrack.jetbrains.com/issue/WEB-36390

0

Excellent!!! 

This works! 

1

Please sign in to leave a comment.