I'm writing a node application, where I would like to mix Reason and raw JavaScript.
This section in the bucklescript documentation describes it
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.
I assume that this is in the bsconfig.json
file? But what value should the key have? The schema documentation does not mention this option.
I'm running Bucklescript version 1.9.1 - so the functionality should be available (available since 1.9.0).
How do I use the in-source
option?
My bsconfig.json
file looks like this:
{
"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"
]
}
It should be in the "package-specs" section:
{
...
"package-specs" : [{
"module": ...,
"in-source": true
}]
}
So your bsconfig.json
should look like:
{
"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"
]
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With