【发布时间】:2020-11-07 16:21:57
【问题描述】:
使用 Reason 和 React 构建组件总是会给我一个“react”的模块导入语句,如果 React 包含在 CDN 中,则无法找到该语句。有解决方案吗?我试图在 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
【问题讨论】:
标签: reactjs reason bucklescript reason-react rescript