Appending .js extension on relative import statements during Typescript compilation (ES6 modules)

前端 未结 3 2063
悲&欢浪女
悲&欢浪女 2020-12-07 03:28

This seems to be a trivial problem, but it is not very obvious what settings/configurations need to be used to solve this issue.

Here are the Hello World program dire

3条回答
  •  我在风中等你
    2020-12-07 04:13

    I usually just use the .js extension in import statements in typescript files as well and it works.

    Not using a file extension in import paths is a nodejs only thing. Since you are not using commonjs but module you are not using nodejs. Therefore you have to use the .is extension in import paths.

提交回复
热议问题