Module imports need to recognize/ignore the file extension #4595
Description
Currently, TS can't find modules when you use a file extension in the import name (import {Foo} from './foo.ts';
) - SystemJS updated and file extensions are now required (though the spec issue is still under discussion) on imports (without setting some legacy settings in System.config
). So when compiling with --module
, you can either have a functioning typechecker (no extensions on your imports) or a functioning runtime (.js
on your imports, since your result files have .js
extensions). This is complicated further by systemjs's bundler, which looks for dependent files before TS transpiles them, so you have to use .ts
extensions on your imports so the bundler can resolve the paths to real ones.
This extension madness is all incredibly awkward to work with, and I'm not sure if this needs module resolution logic updating on our part, arguing for old behavior on the loader spec, or talking to systemjs
and having them change how they're finding modules ignoring the spec.
Activity