From a19ec1a07ce753553d35ba2ce349aa1ac2ca7c9e Mon Sep 17 00:00:00 2001 From: Florian Hammerschmidt Date: Thu, 5 Oct 2023 10:08:48 +0200 Subject: [PATCH] Document 'public' feature --- pages/docs/manual/latest/build-configuration.mdx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pages/docs/manual/latest/build-configuration.mdx b/pages/docs/manual/latest/build-configuration.mdx index 6b642acc0..debce5225 100644 --- a/pages/docs/manual/latest/build-configuration.mdx +++ b/pages/docs/manual/latest/build-configuration.mdx @@ -66,6 +66,18 @@ You can mark your directories as dev-only (for e.g. tests). These won't be built } ``` +You can also explicitly allow which modules can be seen from outside. This feature is especially useful for library authors who want to have a single entry point for their users. +Here, the file `src/MyMainModule.res` is exposed to outside consumers, while all other files are private. + +```json +{ + "sources": { + "dir": "src", + "public": ["MyMainModule"] + }, +} +``` + ## bs-dependencies, bs-dev-dependencies List of ReScript dependencies. Just like `package.json`'s dependencies, they'll be searched in `node_modules`.