A project I am working with is using this package: https://www.npmjs.com/package/@ethersproject/abstract-provider
within an SDK we are building..
After installation, the SDK node_modules folder contains the @ethersproject directory which contains an abstract-provider directory as well as multiple other directories, each their own namespace with separate package.json files.
We use the code in the sdk as follows:
import { Provider } from '@ethersproject/abstract-provider';
and this works fine for webpack based projects which import our SDK (such as a React app using create-react-app).
When I want to use our SDK in a project which DOESN'T use a bundler such as webpack (such as a very simple frontend pulling in our sdk with importmap as here: https://github.com/unegma/rainprotocol__verify-gating), we are getting an error:
Failed to resolve module specifier "@ethersproject/abstract-provider". Relative references must start with either "/", "./", or "../".
I'm assuming this is because our SDK doesn't know how to resolve @ethersproject/abstract-provider because abstract-provider is a submodule of @ethersproject (which isn't even a module itself).
What is the way to solve this issue? Do we need to create a decs.d.ts file in our SDK root which contains something like: declare module "@ethersproject/abstract-provider; or is there a different way to do this?