I am using WebStorm. On Ctrl + Click I am able to jump to file of definition:
import myClass from '../../../../core/myClass';
But if I am using a jsconfig.json
file, it doesn't work.
/// jsonfig.json
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"Core/*": ["./app/bundles/core/*"],
}
},
"exclude": [
"node_modules"
]
}
and in my file I replace with :
import myClass from 'Core/myClass';
Bundling is working perfectly, but not jump to file with WebStorm.
Any idea what settings ?
jsconfig.json
is not currently supported by the IDE, please follow WEB-30581 and WEB-36390 for updates
You can 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) in your project root, define the path mappings there, like:
System.config({
"paths": {
"Core/*": "./app/bundles/core/*"
}
});
Update: path aliases defined in jsconfig.json
are supported since 2019.2; see WEB-36390
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With