Skip to content

Per environment flags with js_of_ocaml #1613

@pbiggar

Description

@pbiggar

I want to use different js_of_ocaml flags in my project, depending on whether we are in dev or release profile.

Dune already adds --pretty and --source-maps-inline in dev, however, there are more jsoo options to play with, and I get dramatically better debugging with the recommended settings:

For Debugging: "–pretty –no-inline –debug-info" + eventually "–disable staticeval –disable share"
For Production: "–opt 3". It minimize the generated javascript by applying various optimizations until a fix-point is reached

I tried using an env block, but couldn't make it work any way I tried it. Is there an existing way to do this, and if not:

  • can a way to do this be added?
  • can we pick better defaults for the dev and production env?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions