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
Assume you have the project structure above, and that you'd like to require the file foo/index.ts, from file bar/index.ts.
With the current version of TypeScript you must use the
importfoo= require('../foo/index')
CommonJS-based environments like node and browserify allow you to omit the index part, and use just require('../foo'). I think it would make sense for the typescript compiler to also allow that. (Considering it does look for index.ts in global external modules)
Thanks
The text was updated successfully, but these errors were encountered:
Hi there,
Assume you have the project structure above, and that you'd like to require the file
foo/index.ts
, from filebar/index.ts
.With the current version of TypeScript you must use the
CommonJS-based environments like
node
andbrowserify
allow you to omit theindex
part, and use justrequire('../foo')
. I think it would make sense for the typescript compiler to also allow that. (Considering it does look forindex.ts
in global external modules)Thanks
The text was updated successfully, but these errors were encountered: