The resolution of the module is relative to the current file if the path starts with ./ or ../ .
Here is an example:
/ /src/ /src/thing.ts /main/ /main/submodule.ts /utilities/ /utilities/common.ts
Thus, the correct instruction to import common.ts into submodule.ts would be:
import {common} from '../utilities/common';
You can also use the following root path (note that there is no lead / or any . ):
import {common} from 'src/utilities/common';
This works for me in Visual Studio code with the src parent folder open as a working folder. In my case, I am targeting ES5 with UMD modules.

You can also enable the module if it can be found by going from the current location (this is the NodeJS function). So you can import thing.ts into submodule.ts using:
import {something} from 'thing';
The resolver will check the current folder, then the parent, then the parent parent ... etc.
Absolute versus Relative Paths
When it comes to links on web pages, I agree with you that absolute paths are easier to maintain, especially when resources are distributed at several levels.
When it comes to modules, I'm not sure that I see the same maintenance problem as the paths that refer here “relative to the file that the import statement is displayed” not to the web page. I wonder if this could be applying a very reasonable rule in the wrong place.
source share