BuckleScript

BuckleScript

  • Docs
  • Try
  • API
  • Community
  • Blog
  • Languages icon中文
    • 日本語
    • English
    • Español
    • Français
    • 한국어
    • Português (Brasil)
    • Русский
    • 繁體中文
    • 帮助我们翻译
  • GitHub

›Intro

Intro

  • What & Why
  • Installation
  • New Project
  • Concepts Overview

Interop

  • Overview
  • Cheatsheet
  • Embed Raw JavaScript
  • Common Data Types
  • Intro to External
  • Bind to Global Values
  • Null, Undefined & Option
  • Object
  • Object 2
  • Class
  • Function
  • Import & Export
  • Regular Expression
  • Exceptions
  • JSON
  • Fast Pipe
  • Generate Converters & Helpers
  • Better Data Structures Printing (Debug Mode)
  • NodeJS Special Variables
  • Miscellaneous
  • Browser Support & Polyfills

Build System

  • Overview
  • Configuration
  • Automatic Interface Generation
  • Interop with JS Build System
  • Performance
  • Advanced

Standard Library

  • Overview

Advanced

  • Conditional Compilation
  • Extended Compiler Options
  • Use Existing OCaml Libraries
  • Difference from Native OCaml
  • Compiler Architecture & Principles
  • Comparison to Js_of_ocaml
Translate

New Project

按照上一节的指示安装 BuckleScript 后,可以使用如下语句生成轻量级项目模板:

bsb -init my-new-project

或者,开始一个新的 Reason 项目:

bsb -init my-new-project -theme basic-reason

编译 & 运行刚刚创建的项目:

cd my-new-project
npm run build
node src/demo.bs.js

就是这样! 您已经构建了项目, 并运行得到了 JS 的输出。 你可以随时检查 js 的运行结果,或者添加一些文件到 my-new-project/src 里。 希望我们已经实现了我们的承诺,它是一个能够生成干净的编译结果的精巧的工具链 =)。

我们将在随后的章节解释 bsb(由上面的 npm run build得到)。

编辑器集成

We share the same editor integration as Reason. See the setup here then here.

← 上一页下一页 →
  • 编辑器集成