I have a somewhat complex build setup. The file layout is like this:
└── bin/
├── theme/
│ └── js-source/
│ └── main.js
├── main.ml
└── dune
I need to use esbuild to generate theme/main.js and to then use the install stanza to copy the entire theme directory to the installation site. Presently the problem is that the output of the rule that runs esbuild places the file in the _build directory, but the install stanza copies the theme directory directly from the source tree.
I have two possible solutions in mind, but have not been able to implement them:
- Make sure that the output of the build step gets placed into the source tree directly
- In the
installstanza, specify that it should copy thethemedirectory from the_builddirectory.
(generate_sites_module
(module theme_site)
(sites forester))
(install
(section
(site
(forester theme)))
(files
(glob_files_rec theme/*)))
(subdir
theme
(rule
(target ./main.js)
(deps
js-source/main.js
(source_tree node_modules))
(action
(progn
(run
esbuild
--minify
--bundle
js-source/index.js
--outfile=%{target})))))