How to target subdirectories in BuckleScript bsconfig.json

824 views Asked by At

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.

2

There are 2 answers

2
glennsl On BEST ANSWER

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

0
Charlie-Greenman On

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