UNPKG

2.05 kBMarkdownView Raw
1Using Firescript
2================
3
4Firescript comes with a CLI to transpile the sources into Javascipt.
5Place a `.firescriptrc` file in your project root to set transpiler options.
6The file is interpreted as a `.cson` file.
7
8Transpiler options
9------------------
10
11| Option | Default value | Description |
12| -------- | ------------- | ------------------------------------------------------------------------------------------ |
13| dest | `lib/` | Destination folder for transpiled `.js` files |
14| src | `src/` | Source folder, where the `.fire` files are |
15| features | `{}` | Configuration object for language features. See [Langauage features](#Language%20features) |
16| copy | `[]` | Copy files from `src` or `$ROOT` to `dest` |
17
18
19### Language features
20
21| Option | Default value | Description |
22| ------------ | ------------- | --------------------------------------------- |
23| esModules | `false` | Transpile `import` and `export` statements into EcmaScript modules instead of CommonJS modules. |
24
25### Commands
26
27[`watch`](./cli/watch.html) Watches files for changes and run transpilation of a changed file.
28
29
30### Features
31
32#### esModules
33
34Enable `import` and `export` statements.
35
36| Type | Firescript | ESM | CommonJS |
37| -------------- | -------------------------------- | --------------------------- | --------------------------------------- |
38| Named import | import banana from 'banana' | import banana from 'banana' | const banana = require('banana').banana |
39| Default import | import default as banana from 'banana' | | |