由于await
仅可在异步函数内部使用,因此下面的代码不起作用。
const config_path = 'https://test.cdn.com/conf.' + location.hash.include('DEV')?'development.ts':'production.ts'
const promise = import(config_path)
export default config = await promise
那么有什么方法可以在es / ts模块中导出诺言的结果吗?