Go to definition with import's namespace
Hey,
I'm trying to use Babel Plugin for JavaScript Namespaces and I can’t figure out how to make Go To Definition working — currently I end up with “Cannot find declaration to go to”.
I'd appreciate any help or tips.
Please sign in to leave a comment.
Thgere are dozens of plugins defining their own ways to resolve modules, we can't afford providing special support for any of them... You can try using webpack aliases instead, or try a workaround from https://youtrack.jetbrains.com/issue/WEB-22717#focus=streamItem-27-1558931-0-0:
- create a file config.js (you can use a different name if you like) in your project root dir
- define your aliases there using the following syntax:
System.config({"paths": {
"<utils>/*": "./src/js/*"
}
});
`<utils>` here is the alias you have defined in
.babelrcNow you can use imports like
in your code
Thank you. It did the trick!