Skip to content

docs(melange): start design choices section #11931

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions doc/melange.rst
Original file line number Diff line number Diff line change
Expand Up @@ -298,3 +298,19 @@ well if you need to override the build rules in one of the packages.
(vendored_dirs reason-react)
(dirs reason-react))


Design choices
=====================

Melange support in Dune follows the following design choices:

- :ref:`melange-emit` produces a "total" directory: the artifacts in the
``target`` dir contain all the JavaScript and ``runtime_deps`` assets
necessary to run the application either through a JS framework, a bundler, or
otherwise a deployment (excluding external dependencies installed via a JS
package manager). The structure is designed such that relative paths and
dependencies work out of the box relative to their paths in the source tree,
before compilation.
- public libraries are compiled to ``%{target}/node_modules/%{lib_name}`` such
that the `resolution algorithm <https://nodejs.org/api/modules.html#all-together>`_
works to resolve Melange libraries from compiled JS code.
Loading