-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Module lookup in ES6. #88
Comments
ES6 doesn't specify anything about the meaning of the contents of the module specifier (the string at the end of The hosting environment (browser, node, etc) has to provide a module loader that interprets the contents of the module specifier in a way that makes sense for that env. In node, I imagine the paths will be local file system paths (and behave accordingly), while in the browser, the paths will likely have to be interpreted as remote URLs (and behave accordingly). The differences you observe may just be an artifact of the reality that module loaders are still un/under specified, so it's all still being sorted out. In any case, it's not an ES6 issue but a web platform issue. |
Save Questions. What's the ES6 module lookup rules? How does it work?
How does es6 know where is the react. |
@mrdulin Again, this is not a part of ES6 standard. Path/module resolving should be made by current environment and could differ from one to another. |
@hlomzik |
This is not a general support forum. ES6 doesn't specify how the modules are loaded. This repo has nothing to add to your questions. Perhaps try other support forums? |
@getify OK, I know it. Anyway, Thank you! |
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:
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 thatdir1
which is defined ABOVE the current file.dir1
it tries to finddir2/dir3/file
there.Is my assumption correct?
The text was updated successfully, but these errors were encountered: