ad1992 / fuzzify

A tiny lightweight library for Fuzzy Search
https://fuzzify.vercel.app
MIT License
88 stars 5 forks source link

build package with full file extension #15

Closed shrilakshmishastry closed 3 months ago

shrilakshmishastry commented 3 months ago

Hey @ad1992 👋 Good work on fuzzi logic 👏

I am facing the below issue, can you please look into it or assign me?

Issue: Unable to resolve file or component due to missing file extension in the import statement. This is happening because the target of tsc is esNext, whereas the consuming package that uses webpack targets es5

Not able to resolve utils

Screenshot 2024-08-03 at 4 51 13 PM

Not able to get fuzzzy

Screenshot 2024-08-03 at 4 51 29 PM

Solution:

When the package is consumed in other packages, since the bundler will use the bundled package, it doesn't resolve the extension. The fuzzify package needs to configure the tsc to compile to all browser or consuming package supporting a common version i.e es5

ad1992 commented 3 months ago

@shrilakshmishastry this is issue specific to webpack and since the dev mode still uses webpack hence the above error, I have pushed the fix in react-tags repo in https://github.com/react-tags/react-tags/pull/986 and now it should work. Also for the integration please use the version 0.1.2-test3, I have pushed the type fixes to the library so type imports would work fine too.