Quick Links
  • -Overview
  • -Language Features
  • -JS Interop
  • -Build System
Documentation
Language Manual
Reference for all language features
ReScript & React
First class bindings for ReactJS
GenType
Seamless TypeScript integration
Reanalyze
Dead Code & Termination analysis
Exploration
Packages
Explore third party libraries and bindings
Syntax Lookup
Discover all syntax constructs
APIPlaygroundBlogCommunity
  • Playground
  • Blog
  • X
  • BlueSky
  • GitHub
  • Forum
Language Manual
Overview
  • Introduction
  • Installation
  • Editor Plugins
  • Migrate to ReScript Syntax
  • Try
Language Features
  • Overview
  • Let Binding
  • Type
  • Primitive Types
  • Tuple
  • Record
  • Object
  • Variant
  • Polymorphic Variant
  • Null, Undefined and Option
  • Array & List
  • Function
  • If-Else & Loops
  • Pipe
  • Pattern Matching / Destructuring
  • Mutation
  • JSX
  • Exception
  • Lazy Value
  • Async & Promise
  • Module
  • Import & Export
  • Attribute (Decorator)
  • Unboxed
  • Reserved Keyword
JavaScript Interop
  • Interop Cheatsheet
  • Embed Raw JavaScript
  • Shared Data Types
  • External (Bind to Any JS Library)
  • Bind to JS Object
  • Bind to JS Function
  • Import from / Export to JS
  • Bind to Global JS Values
  • JSON
  • Inlining Constants
  • Use Illegal Identifier Names
  • Generate Converters & Helpers
  • Browser Support & Polyfills
  • Libraries & Publishing
Build System
  • Overview
    • Build Project
    • Clean Project
  • Configuration
  • Configuration Schema
  • External Stdlib
  • Pinned Dependencies
  • Interop with JS Build Systems
  • Performance
Guides
  • Converting from JS
Extra
  • Newcomer Examples
  • Project Structure
  • FAQ
Docs / Language Manual / Overview
Edit

Build System Overview

ReScript comes with a build system, bsb, that's meant to be fast, lean and used as the authoritative build system of the community.

The build description file is called bsconfig.json. Every ReScript project needs one.

Build Project

Each build will create build artifacts from your project's source files.

To build a project (including its dependencies / pinned-dependencies), run:

SH
bsb -make-world

Add -w to keep the built-in watcher running. Any new file change will be picked up and the build will re-run.

Note: third-party libraries (in node_modules, or via pinned-dependencies) aren't watched, as doing so may exceed the node.js watcher count limit.

Note 2: In case you want to set up a project in a JS-monorepo-esque approach (yarn workspaces / lerna) where changes in your sub packages should be noticed by the compiler (bsb -make-world), you will need to define pinned dependencies in your main project's bsconfig.json. More details here.

To build only your project's files (without dependencies), run:

SH
bsb

Clean Project

If you ever get into a stale build for edge-case reasons, use:

SH
bsb -clean-world

This will clean all your project's build artifacts, including those in your dependencies. Alternatively you can run bsb -clean to clean your project's build artifacts only.

For more infos, run bsb -help to see all the available options.

Libraries & PublishingConfiguration

© 2024 The ReScript Project

Software and assets distribution powered by KeyCDN.

About
  • Community
  • ReScript Association
Find us on