使用Reason和React构建组件始终会为我提供“反应”的模块导入语句,如果CDN中包含React,则无法找到该语句。有解决方案吗?我试图在index.html中定义window.react = React
,但没有成功。 es6-global
设置不会更改任何内容。
我没有使用像webpack这样的捆绑程序。
编辑:原因论坛中可能相关的主题:https://reasonml.chat/t/can-one-load-reasonml-es6-modules-without-a-bundler/2219
类似的问题(未解决):can one load reasonml es6 modules without a bundler
importmap
(尚未在浏览器中实现)可能是对此的另一种解决方案:Using ES6 Modules without a Transpiler/Bundler step