I'm using Create React App and Yarn workspaces and have all my code in packages. Here is an example of my workspace structure.
I do my builds from `workspace/apps/src/app1` so relative paths are all from there. Component2 needs to import Component1 and since they're in the same package IntelliJ imports using this.
import Component1 from '../../../a/b/c/Component1';
import Component1 from 'components/a/b/c/Component1';
This doesn't work since I'm building in `workspace/apps/src/app1` and it tries to find the file in `src/app1/components/a/b/c/Component1`
In `packages/common/package.json` I have "name": "@company/common" and I need to have the import be this even if the file is in the same package.
import Component1 from '@company/common/components/a/b/c/Component1';
I've tried all kinds of things and no luck. How can I do this?