7

I have the following folder structure

--| button
--|--| button.re
main.re

In my bsconfig.json, using the quickstart guide found here. I have in my config the following key/value:

"sources": [
  "src/"
]

It is only targeting the main.re file. I have tried some conventional config options such as *.re, but to no avail. If I would like to target all sub-directories, how would I do so? Thank you.

glennsl
  • 28,186
  • 12
  • 57
  • 75
Charlie-Greenman
  • 1,469
  • 1
  • 16
  • 36
  • One way to circumvent the problem is to not have nested directories at all, and instead put all your source files in a single directory, with names like `ui_Button.re`. You'll then also need a 'table of contents' module for each level of the hierarchy to set up the nested module structure using module aliases, e.g. in `ui.re`: `module Button = Ui_Button`. – Yawar Sep 14 '17 at 04:52

2 Answers2

10

There was actually a PR merged just yesterday that adds support for directory traversal. It'll be in the next release, which should be out shortly.

The configuration will then be:

"sources": [{"dir": "src", "subdirs": true}]

Edit: This feature was released in 1.9.2

glennsl
  • 28,186
  • 12
  • 57
  • 75
  • I will say I am running across some errors using the above, and will try to be vocal in github repo. – Charlie-Greenman Sep 17 '17 at 20:17
  • 1
    Happy to help! You're more than welcome to hop on to the [Reason Discord](https://discord.gg/reasonml) to ask for help too. The author of BuckleScript hangs around there as well. – glennsl Sep 17 '17 at 20:32
6

Looking at documentation the solution would be the following:

"sources": [{"dir": "src", "subdirs": ["button"]}],

Source for documentation: https://bucklescript.github.io/bucklescript/docson/#build-schema.json

Charlie-Greenman
  • 1,469
  • 1
  • 16
  • 36