I find that the import path in ES6 modules is very confusing when used in the Ember CLI. For example, if I want to import a model into my application, I do something like this:
import User from '../../../../../models/user';
This is a trial and error exercise, as itβs hard to easily understand how deep in the folder tree I use it. Even worse, if I reorganize my files, everything breaks.
Thus, I can use the absolute path as follows:
import User from 'app-name/models/user';
I prefer not to recode the application name in the path, because it can change.
Is there an abbreviation for the root of the application?
./ does not work because ./ implies the current path.
import User from './models/user';
source share