Quantcast
Channel: OCaml - Topics tagged dune
Viewing all articles
Browse latest Browse all 521

Dune. Copy multiple dependencies to _build directory in `rule` stanza

$
0
0

@monstasat wrote:

Hello,

I am developing a web server. Style sheets are written using SASS, and I want dune to process my .scss files to produce one .css file to be included in the resulting package.

Here is my dune file which tries to build a single .css file:

(rule
  (targets main.min.css)
  (deps 
        (:src ./stylesheets/main/main.scss)
        (:scss ./stylesheets))
  (action (run %{bin:scss} --load-path %{scss} %{src} %{targets})))

(install
  (files (main.min.css as css/main.min.css))
  (section share)
  (package myserver))

scss binary need to know where to search for source files, and the directory with the sources is indicated under the --load-path argument. I am trying to pass this directory as a :scss dependency.

The output of dune build @install is:

Error: No rule found for dist/resources/css/stylesheets

where dist/resources/css is a directory containing dune file.

Seems that a directory cannot be a dependency in dune.
What should I do to copy necessary source files to _build directory before running an action defined in rule stanza?

Alex

Posts: 5

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 521

Trending Articles