ReasonML Quick Start Guide
上QQ阅读APP看书,第一时间看更新

Setting Up a Development Environment

In addition to being a new syntax for OCaml, Reason is a toolchain that makes it easy to get started. In this chapter, we'll do the following:

  • Learn about the Reason toolchain
  • Configure our editor
  • Use bsb to start a pure Reason project
  • Learn about bsconfig.json
  • Write an example pure Reason application that manipulates the DOM
  • Use bsb to start a ReasonReact project
  • Get comfortable using webpack within a Reason project

To follow along, clone this book's GitHub repository and start from this chapter's directory. You're also welcome to start from a blank project:

git clone https://github.com/PacktPublishing/ReasonML-Quick-Start-Guide.git
cd ReasonML-Quick-Start-Guide
cd Chapter02/pure-reason-start
npm install

This chapter is meant to get you comfortable with the Reason toolchain. We'll have separate development environments for the pure Reason project and the ReasonReact one. After following along, you'll be comfortable enough to tweak the development environment to your liking. Don't worry about messing anything up, since we'll start fresh in Chapter 3Creating ReasonReact Components, from another directory.