Dune - How To Export All Modules In Folder

I have a project where I want to access all the modules in a directory from different packages. Currently, the directory in question is like:

dir
|- a.ml
|- b.ml
|- c.ml
|- lib.ml

Instead, of writing the following in lib, the main export of the directory:

module A = A
module B = B
module C = C

I use the following in my dune file:

(library
   (name lib)
   (modules a b c))

Is there any wildcard or regex I can use with Dune to specify “export all the modules in this folder as visible”? Instead of specifying every file by hand. I haven’t really found anything in the documentation about this

Thanks!

1 Like

You don’t need to do either. Exporting all modules from Lib is Dune’s default behaviour.

1 Like

If you get rid of the lib.ml file it will just export every module. (Then you can just get rid of the modules stanza in your dune file.)