|
1 | 1 | ---
|
2 | 2 | title: "Configuration"
|
3 | 3 | metaTitle: "Build System Configuration"
|
4 |
| -description: "Details about the configuration of the ReScript build system (bsconfig.json)" |
| 4 | +description: "Details about the configuration of the ReScript build system (rescript.json)" |
5 | 5 | canonical: "/docs/manual/latest/build-configuration"
|
6 | 6 | ---
|
7 | 7 |
|
8 | 8 | # Configuration
|
9 | 9 |
|
10 |
| -`bsconfig.json` is the single, mandatory build meta file needed for `rescript`. |
| 10 | +`rescript.json` (or `rescript.json` in versions prior ReScript 11) is the single, mandatory build meta file needed for `rescript`. |
11 | 11 |
|
12 | 12 | **The complete configuration schema is [here](./build-configuration-schema)**. We'll _non-exhaustively_ highlight the important parts in prose below.
|
13 | 13 |
|
14 | 14 | ## name, namespace
|
15 | 15 |
|
16 |
| -`name` is the name of the library, used as its "namespace". You can activate namespacing through `"namespace": true` in your `bsconfig.json`. Namespacing is almost **mandatory**; we haven't turned it on by default yet to preserve backward-compatibility. |
| 16 | +`name` is the name of the library, used as its "namespace". You can activate namespacing through `"namespace": true` in your `rescript.json`. Namespacing is almost **mandatory**; we haven't turned it on by default yet to preserve backward-compatibility. |
17 | 17 |
|
18 | 18 | **Explanation**: by default, your files, once used as a third-party dependency, are available globally to the consumer. E.g. if you have an `Util.re` and the consumer also has a file of the same name, they will clash. Turning on `namespace` avoids this by wrapping all your own project's files into an extra module layer; instead of a global `Util` module, the consumer will see you as `MyProject.Util`. **The namespacing affects your consumers, not yourself**.
|
19 | 19 |
|
20 | 20 | Aka, in ReScript, "namespace" is just a fancy term for an auto-generated module that wraps all your project's files (efficiently and correctly, of course!) for third-party consumption.
|
21 | 21 |
|
22 | 22 | We don't do folder-level namespacing for your own project; all your own file names must be unique. This is a constraint that enables several features such as fast search and easier project reorganization.
|
23 | 23 |
|
24 |
| -**Note**: the `bsconfig.json` `name` should be the same as the `package.json` `name`, to avoid confusing corner-cases. However, this means that you can't use a camelCased names such as `MyProject`, since `package.json` and npm forbid you to do so (some file systems are case-insensitive). To have the namespace/module as `MyProject`, write `"name": "my-project"`. ReScript will turn that into the camelCased name correctly. |
| 24 | +**Note**: the `rescript.json` `name` should be the same as the `package.json` `name`, to avoid confusing corner-cases. However, this means that you can't use a camelCased names such as `MyProject`, since `package.json` and npm forbid you to do so (some file systems are case-insensitive). To have the namespace/module as `MyProject`, write `"name": "my-project"`. ReScript will turn that into the camelCased name correctly. |
25 | 25 |
|
26 | 26 | **Note on custom namespacing**: if for some reason, you need a namespace that is different from what your `name` will produce, you can directly send a string to the `namespace` option. For example, if your package is a binding named `bs-some-thing`, you can use `"namespace": "some-thing"` to get `SomeThing` namespace instead of `BsSomeThing`.
|
27 | 27 |
|
@@ -148,7 +148,7 @@ Output to either CommonJS (the default) or ES6 modules. Example:
|
148 | 148 | - `"module": "es6-global"` resolves `node_modules` using relative paths. Good for development-time usage of ES6 in conjunction with browsers like Safari and Firefox that support ES6 modules today. **No more dev-time bundling**!
|
149 | 149 | - `"in-source": true` generates output alongside source files. If you omit it, it'll generate the artifacts into `lib/js`. The output directory is not configurable otherwise.
|
150 | 150 |
|
151 |
| -This configuration only applies to you, when you develop the project. When the project is used as a third-party library, the consumer's own `bsconfig.json` `package-specs` overrides the configuration here, logically. |
| 151 | +This configuration only applies to you, when you develop the project. When the project is used as a third-party library, the consumer's own `rescript.json` `package-specs` overrides the configuration here, logically. |
152 | 152 |
|
153 | 153 | ## suffix
|
154 | 154 |
|
|
0 commit comments