-
Notifications
You must be signed in to change notification settings - Fork 1
/
dune
28 lines (25 loc) · 1.4 KB
/
dune
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
; `dirs` is a stanza to tell dune which subfolders from the current folder
; (where the `dune` file is) it should process. Here it is saying to include
; all directories that don't start with . or _, but exclude node_modules.
(dirs :standard \ node_modules)
; `melange.emit` is a Dune stanza that will produce build rules to generate
; JavaScript files from sources using the Melange compiler
; https://dune.readthedocs.io/en/stable/melange.html#melange-emit
(melange.emit
; The `target` field is used by Dune to put all JavaScript artifacts in a
; specific folder inside `_build/default`
(target output)
; Here's the list of dependencies of the stanza. In this case (being
; `melange.emit`), Dune will look into those dependencies and generate rules
; with JavaScript targets for the modules in those libraries as well.
; Caveat: the libraries need to be specified with `(modes melange)`.
(libraries reason-react)
; The `preprocess` field lists preprocessors which transform code before it is
; compiled. melange.ppx allows to use Melange attributes [@mel. ...]
; (https://melange.re/v2.0.0/communicate-with-javascript/#attributes)
; reason-react-ppx allows to use JSX for ReasonReact components by using the
; [@JSX] attributes from Reason: https://reasonml.github.io/docs/en/jsx
(preprocess
(pps melange.ppx reason-react-ppx))
; module_systems lets you specify commonjs (the default) or es6
(module_systems es6))