4

In a Node.js app with installed npm dependencies, I'm importing a module like that:

import { Admin } from 'react-admin';

When I hover on the 'Admin' name and choose 'Go to definition', VSCode displays the compiled source, taken from node_modules/react_admin/lib/index.js, instead of the more readable, ES6 source located under node_modules/react_admin/src/index.js.

How can I (or the 'react-admin' package author) tell VSCode to jump to the non-compiled source when hitting 'go to definition'?

Armel Larcier
  • 15,747
  • 7
  • 68
  • 89
François Zaninotto
  • 7,068
  • 2
  • 35
  • 56
  • Hi ! I have the same problem, and more with packages exported from ra-core and ra-ui-materialui for which I have no way to 'Go to definition'. I tried `jsconfig.json` with no luck. I'm considering ejecting from CRA and try using webpack's config aliases but it does not seem like the way to go since we just want to change IDE behaviour, not the build process... – Armel Larcier Jan 26 '19 at 11:09
  • I've tried deleting the "module" field on the `package.json`, and even though navigating to the package does go to ìndex.ts` now, it still doesn't resolve the individual components. – JaviCasa Apr 13 '20 at 23:07

0 Answers0