ocaml - 如何在 esy 项目中使用 bucklescript 库和 rtop ?

标签 ocaml reason bucklescript utop esy

我正在尝试在 esy 项目上使用 rtop 作为 repl。

为此,我已将 "@esy-ocaml/rtop":"*" 添加到 package.json 文件的 devDependencies 部分,并且尝试使用 esy rtop 启动 rtop:

{
  ...,
  "dependencies": {
    "react": "^16.2.0",
    "react-dom": "^16.2.0",
    "reason-react": ">=0.4.0"
  },
  "devDependencies": {
    "bs-platform": "^4.0.14",
    "html-webpack-plugin": "^3.2.0",
    "webpack": "^4.0.1",
    "webpack-cli": "^3.1.1",
    "webpack-dev-server": "^3.1.8",
    "@esy-ocaml/rtop":"*"
  }
}

但是,我无法加载我的组件:

→ esy rtop
Reason # #use "./src/Component1.re";
File "./src/Component1.re", line 2, characters 5-16:
Error: Unbound module ReasonReact

Reason # #require "reason-react";
No such package: reason-react

Reason # #require "react";

Reason #

但是,正如你所看到的,我能够加载 React,无论这意味着什么......

那么,我如何使用 rtop 作为我的项目 repl?

最佳答案

我还有asked this in reasonml.chat答案如下

Esy doesn’t magically make bs-platform works with native toolings.

rtop is exclusively for native only and can’t be use in a bucklescript project

关于ocaml - 如何在 esy 项目中使用 bucklescript 库和 rtop ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54043062/

相关文章:

ocaml - 什么是 PPX?

reason - 如何在 ReasonReact 中共享 props?

ocaml - 如何编写自定义 ppx 装饰器来重写脚本?

syntax - OCaml 的替代字符串语法 {|...|} 在哪里记录?

javascript - ReasonML 对命令式 vanilla JavaScript 的性能

promise - 为什么需要调用resolve()?

types - 如何使用 Js.Dict.t 类型为 Js.Dict.get

javascript - js_of_ocaml 和 Deriving_Json

ocaml - 有没有办法在以某个值开头的字符串上找到 `match`?

debugging - 将 OCaml 转换为 F# : Is there a simple way to simulate OCaml top-level #trace in F#