Description
Apologies if this exists and I just couldn't find documentation on it. We have several in-house npm packages to offer common functionality across our codebases. Each of these packages defines subpath exports
entries to directly target individual functions and components, in addition to getting everything from the root entry. To use an example with MUI, you can do either of these:
import { Grid } from '@mui/material';
or
import Grid from '@mui/material/Grid'`
The problem is, the auto-import completion rarely even lists the later, just the former, or sometimes, when it does go deeper, it tries to import the direct file (eg, @mui/material/node/Grid/Grid.js
) instead of using the subpath export.
It would be very helpful if I, as a package author, could give weight to the exports so that I can tell vscode "this is actually the better path to use for suggesting this export."