unimported icon indicating copy to clipboard operation
unimported copied to clipboard

Support pure ESM with .tsx

Open maclockard opened this issue 1 year ago • 1 comments

Related to https://github.com/smeijer/unimported/issues/66.

Unfortunately pathTransforms doesn't seem to work well when dealing with both .ts and .tsx files.

With the new typescript module import path stuff, I believe that the import path needs to be written as whatever extension the built file will have. This means that both .ts and .tsx files will be built as .js files. Unfortunately, pathTransforms doesn't seem to support mapping .js files to multiple possible file extensions.

maclockard avatar Jun 16 '23 17:06 maclockard

I've ended up just stripping the extension entirely which appears to work?

"pathTransforms": {
  "(\\..+)\\.js$": "$1"
}

maclockard avatar Jun 16 '23 17:06 maclockard

This project is being archived. Please check the readme for more info.

smeijer avatar Mar 10 '24 19:03 smeijer