Is it possible to dynamically import a static client asset from the server?

Let's say I have a ts/js file that exports some JSON that I would like a server query/action to have access to, but I want to pass the file name to the query/action. Currently I have query code like this:

const getContractABI: GetContractABI = async ({address}, context) => {
  const {default: contract} = await import(`contracts/${address}.js`);

  return contract.abi;
};


Where would I put that ts/js file and is it even possible to do what I'm trying here?
Was this page helpful?