Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic requires don't work in Vite #566

Open
kay-is opened this issue Apr 19, 2023 · 0 comments
Open

Dynamic requires don't work in Vite #566

kay-is opened this issue Apr 19, 2023 · 0 comments

Comments

@kay-is
Copy link
Contributor

kay-is commented Apr 19, 2023

I tried a few things to get this to work (Rollup and Vite plugins), but I guess it isn't possible.

My workaround was to replace the following line:

const { handle } = require(`weavedb-contracts/${key}/contract`)

With that code:

const { handle } = require("weavedb-contracts/ethereum/contract")

There don't seem to be many options, so it might be feasible to just switch through the 4 contracts available and explicitly write out every require.

I don't even know if all contracts in that directory are used in that line, so it might be even less than 4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant