You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ivo Gabe de Wolff (@ivogabe) yes, now we'll use whatever host has returned to us as resolvedFileName. However in general host should be able to handle correct paths no matter in what form they are represented (whether they are relative to current directory or absolute) without making any assumptions. There are few reasons for this:
compiler can choose different representation to store files internally as long as it is correct (store absolute paths vs. store paths that are relative to current directory)
the order in which compiler processes files is implementation-specific. This means that for files below following events might happen in different order in different versions of the compiler ts // a.ts import x from "b" ...
// b.tsexportdefaultclass{...}
compiler asks host to get source file a.ts (from the command line)
compiler asks host to get source file b.ts (from the command line)
compiler asks host to resolve module name b relative to containing file a.ts
compiler asks host to get source file .../b.ts (result of module resolution, can be absolute path if host returns such).
Currently we do natural depth first traversal so the order of events is 1, 3, 4 (we skip 2 since at the point when we start processing second item in the list of root files we discover that this file was already processed ). However it is possible that at some point we might change the implementation and order will be: 1, 2, 3 - process root files first and then start resolving module names. In this case we skip 4 since we already have this file.
Activity
mhegazy commentedon Oct 29, 2015
can you share more information?
mhegazy commentedon Oct 29, 2015
are you using typescript through an extension to webpack, gulp, gurnt, browserify, etc..
ivogabe commentedon Nov 3, 2015
Mohamed Hegazy (@mhegazy) Vladimir Matveev (@vladima) It looks like #5462 has reverted this behavior, is that right?
vladima commentedon Nov 3, 2015
Ivo Gabe de Wolff (@ivogabe) yes, now we'll use whatever host has returned to us as
resolvedFileName. However in general host should be able to handle correct paths no matter in what form they are represented (whether they are relative to current directory or absolute) without making any assumptions. There are few reasons for this:ts // a.ts import x from "b" ...a.ts(from the command line)b.ts(from the command line)brelative to containing filea.ts.../b.ts(result of module resolution, can be absolute path if host returns such).Currently we do natural depth first traversal so the order of events is
1,3,4(we skip2since at the point when we start processing second item in the list of root files we discover that this file was already processed ). However it is possible that at some point we might change the implementation and order will be:1,2,3- process root files first and then start resolving module names. In this case we skip 4 since we already have this file.