const config = async () => {
return await import("../test");
}
console.log(config);
../test
export const config = {
value1: 1,
value1: 2,
};
I want config in ../test but this returns [AsyncFunction: config].
async () => {} is a function declaration. So you assigned config to a function.
You have to call that function, and await the result, in order to get the value you want.
console.log(await config());
But are you sure you want a dynamic import here?
Because this should do the same thing without any headaches at all.
import { config } from "../test";