-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Open
Description
I'm trying to understand the way modules are loaded in ES6. I was googling this question for like half of hour but never found the exact definition. See the example:
import * as smth from 'dir1/dir2/dir3/file'
You can see that it's different from relative path like ./dir1/dir2/dir3/file
. I was messing with this in TypeScript + NodeJS and it's lookup strategy is different from the one I used to work with in NodeJS. What I found is that
- it will lookup for
dir1
which is defined ABOVE the current file. - If it finds
dir1
it tries to finddir2/dir3/file
there. - if it fails it continues step 1-2 again and so on.
Is my assumption correct?
Metadata
Metadata
Assignees
Labels
No labels