searchfe / ts2php

Typescript to PHP Transpiler.
https://searchfe.github.io/ts2php/
MIT License
92 stars 20 forks source link

fix: keep extension name in import specifier #118

Closed harttle closed 4 years ago

harttle commented 4 years ago

对于 import "./foo.bar" 来讲,extname 是 .bar 会被移除,因此会被编译成 require_once(dirname(__FILE__) . '/' . "./foo"); 是不正确的。

考虑到除了 json 等需要特殊判断的情况,正常情况下 specifier 都是不带 extname 的,因此默认应保持 extname。

cxtom commented 4 years ago

:tada: This PR is included in version 0.26.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: