Custom import paths jsconfig.json

So when using something that rewrites import paths -- specifically: babel-plugin-root-import -- we lose intellisense.

This is very useful for large projects, because it avoids deeply nested path resolutions, e.g.

import 'thing-to-test' from '../../../../../src/feature/subfeature/helper/thing

These are a big nuisance because apart from being ugly & it's hard to locate the file in the first place, anytime you move a code block, you have to refactor them. The aforementioned module lets you define an alias like "~=/src" and then just:

import 'thing-to-test' from '~/feature/subfeature/helper/thing

in vscode is ok when i use jsconfig but in webstorm not work. =S

"compilerOptions": {
"baseUrl": ".",
"paths": {
"~/*": ["src/*"]
"target": "ES6",
"jsx": "preserve",
"allowSyntheticDefaultImports": true
1 comment

jsconfig.json is not currently supported, please follow and


You can try a workaround from create a file config.js (you can use a different name) in your project root, define the path mappings there, like:

    "paths": {
        "~/*": "./src/*"

Please sign in to leave a comment.