Project Root Directory Alias For Docker-Based Project

I would like to be able to set an alias for the project root directory. Is there such a setting? 
Instead of relative paths (which tend to be fragile and break when files and folders move around), like this:

import { formatPounds, formatGrams } from '../../../helpers';

We would like to use the absolute path as it is in the Docker container:

import { formatPounds, formatGrams } from '/src/app/helpers';

Our project uses Docker containers both locally and when deployed, so the root is always /src/app, actually.

In PHPStorm, a relative path lets me click through to see the file in question, but using an absolute path means the IDE can't find the file. This is for a Node / React project, but I use PHPStorm for all sorts of things including PHP. Please let me know if there is a way to configure this. 

1 comment
Comment actions Permalink

There's unfortunately no way & no plans to configure this


Please sign in to leave a comment.