favware / esbuild-plugin-file-path-extensions

An esbuild plugin to automatically insert file extensions in your built JavaScript files based on the specified target
MIT License
21 stars 2 forks source link

bug: import external libs does not add 'js' extension for esm #130

Open Lonli-Lokli opened 1 month ago

Lonli-Lokli commented 1 month ago

Is there an existing issue for this?

Description of the bug

So I've tried to add this to my fork with tsup and external imports are not processed

Steps To Reproduce

1) clone https://github.com/Lonli-Lokli/react-mosaic/tree/esm 2) add plugin 3) run 'yarn build'

Expected behavior

import countBy from "lodash-es/countBy"; transformed into import countBy from "lodash-es/countBy.js";

Screenshots

No response

Additional context

No response

favna commented 1 month ago

This is probably a duplicate of #113 but I haven't taken time to investigate it yet. I find it odd though because I really thought this was fixed already by the package matching. What happens if you try to write it as import { countBy } from 'lodash-es';?