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
{{ message }}
This repository was archived by the owner on Dec 1, 2019. It is now read-only.
Since TS 2.0, it's possible to : import { Something } from './something.js';
Module identifiers allow for .js extension
Before TypeScript 2.0, a module identifier was always assumed to be extension-less; for instance, given an import as import d from "./moduleA.js", the compiler looked up the definition of "moduleA.js" in ./moduleA.js.ts or ./moduleA.js.d.ts. This made it hard to use bundling/loading tools like SystemJS that expect URI's in their module identifier.
With TypeScript 2.0, the compiler will look up definition of "moduleA.js" in ./moduleA.ts or ./moduleA.d.ts.
But using this possibility with awesome-typescript-loader results in error : Module not found: Error: Can't resolve './something.js'
It's important to be compatible with ES6 modules, which require the .js extension, as <script type="module"></script> is now in test in all browsers, and as for now TS doesn't provide an option to add the .js extension in transpiled files (see microsoft/TypeScript#13422).
Since TS 2.0, it's possible to :
import { Something } from './something.js'
;But using this possibility with awesome-typescript-loader results in error :
Module not found: Error: Can't resolve './something.js'
It's important to be compatible with ES6 modules, which require the
.js
extension, as<script type="module"></script>
is now in test in all browsers, and as for now TS doesn't provide an option to add the.js
extension in transpiled files (see microsoft/TypeScript#13422).It's possible in rollup/rollup-plugin-typescript so I assume it's possible with awesome-typescript-loader too.
The text was updated successfully, but these errors were encountered: