gpt4 book ai didi

reason - 编译 Reason 源文件到与源文件相同的目录

转载 作者:行者123 更新时间:2023-12-04 19:29:13 24 4
gpt4 key购买 nike

我正在编写一个节点应用程序,我想在其中混合 Reason 和原始 JavaScript。

This section在 bucklescript 文档中对其进行了描述

When user has an existing JS project, it makes sense to output the JS file in the same directory as vanilla JS, the schema added a key called in-source so that generate JS file next to ML file.



我假设这是在 bsconfig.json 中文件?但是 key 应该具有什么值? The schema documentation没有提到这个选项。

我正在运行 Bucklescript 1.9.1 版 - 因此该功能应该可用(自 1.9.0 起可用)。

我如何使用 in-source选项?

我的 bsconfig.json文件如下所示:
{
"name": "re-server",
"version": "0.1.0",
"bsc-flags": ["-bs-super-errors"],
"in-source": true, // I tried adding the key here
"sources": [{
"dir": "src",
"in-source": true // I tried adding the key here
}
],
"bs-dependencies" : [
"bs-express"
]
}

最佳答案

它应该在“package-specs”部分:

{
...
"package-specs" : [{
"module": ...,
"in-source": true
}]
}

所以你的 bsconfig.json应该看起来像:
{
"name": "re-server",
"version": "0.1.0",
"bsc-flags": ["-bs-super-errors"],
"package-specs" : [{
"module": "commonjs",
"in-source": true
}],
"sources": [{
"dir": "src"
}
],
"bs-dependencies" : [
"bs-express"
]
}

关于reason - 编译 Reason 源文件到与源文件相同的目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46757993/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com